File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -395,8 +395,9 @@ fn git_candidates(command_path: Option<&Path>) -> Vec<GitCandidate> {
395395 let mut candidates = Vec :: new ( ) ;
396396 if let Some ( path) = command_path {
397397 candidates. push ( GitCandidate :: Path ( path. to_path_buf ( ) ) ) ;
398+ } else {
399+ candidates. push ( GitCandidate :: Program ( "git" ) ) ;
398400 }
399- candidates. push ( GitCandidate :: Program ( "git" ) ) ;
400401 candidates
401402}
402403
@@ -920,7 +921,7 @@ mod tests {
920921 let fake_git = write_fake_git (
921922 & root,
922923 & format ! (
923- "#!/bin/sh\n if [ \" $1\" = \" --version\" ]; then\n echo 'git version 2.51.0'\n exit 0\n fi\n if [ \" $1\" = \" send-email\" ] && [ \" $2\" = \" -h\" ]; then\n echo 'usage: git send-email [<options>] <file|directory>...'\n exit 129\n fi\n if [ \" $1\" = \" send-email\" ]; then\n printf '%s\n ' \" $@\" > '{}'\n last=''\n for arg in \" $@\" ; do\n last=\" $arg\" \n done\n cp \" $last\" '{}'\n echo 'sent'\n exit 0\n fi\n exit 1\n " ,
924+ "#!/bin/sh\n if [ \" $1\" = \" --version\" ]; then\n echo 'git version 2.51.0'\n exit 0\n fi\n if [ \" $1\" = \" send-email\" ] && [ \" $2\" = \" -h\" ]; then\n echo 'usage: git send-email [<options>] <file|directory>...'\n exit 129\n fi\n if [ \" $1\" = \" send-email\" ]; then\n printf '%s\\ n' \" $@\" > '{}'\n last=''\n for arg in \" $@\" ; do\n last=\" $arg\" \n done\n cp \" $last\" '{}'\n echo 'sent'\n exit 0\n fi\n exit 1\n " ,
924925 capture_args. display( ) ,
925926 capture. display( )
926927 ) ,
You can’t perform that action at this time.
0 commit comments