git2-rs icon indicating copy to clipboard operation
git2-rs copied to clipboard

Fix CredentialHelper::add_command

Open aibaars opened this issue 9 months ago • 0 comments

Previously the add_helper function would check whether the command contains a \ or / character to determine whether it is absolute. It should have used starts_with instead of contains. In addition an absolute on Windows a path my start with a drive letter. The git cli implements this by checking if the second character is a ':'.

See also: https://github.com/git/git/blob/6a64ac7b014fa2cfa7a69af3c253bcd53a94b428/credential.c#L492-L493

Fixes https://github.com/rust-lang/git2-rs/issues/1136

aibaars avatar Mar 05 '25 10:03 aibaars