mirror of
https://github.com/git/git.git
synced 2026-01-24 09:30:22 +00:00
git_connect: prefer Git's builtins over dashed form
This helps with minimal installations such as MinGit that refuse to waste .zip real estate by shipping identical copies of builtins (.zip files do not support hard links). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
@@ -825,6 +825,9 @@ struct child_process *git_connect(int fd[2], const char *url,
|
||||
child_process_init(conn);
|
||||
|
||||
strbuf_addstr(&cmd, prog);
|
||||
/* Prefer the builtin */
|
||||
if (starts_with(prog, "git-"))
|
||||
cmd.buf[3] = ' ';
|
||||
strbuf_addch(&cmd, ' ');
|
||||
sq_quote_buf(&cmd, path);
|
||||
|
||||
|
||||
@@ -332,13 +332,13 @@ expect_ssh () {
|
||||
1)
|
||||
;;
|
||||
2)
|
||||
echo "ssh: $1 git-upload-pack '$2'"
|
||||
echo "ssh: $1 git upload-pack '$2'"
|
||||
;;
|
||||
3)
|
||||
echo "ssh: $1 $2 git-upload-pack '$3'"
|
||||
echo "ssh: $1 $2 git upload-pack '$3'"
|
||||
;;
|
||||
*)
|
||||
echo "ssh: $1 $2 git-upload-pack '$3' $4"
|
||||
echo "ssh: $1 $2 git upload-pack '$3' $4"
|
||||
esac
|
||||
} >"$TRASH_DIRECTORY/ssh-expect" &&
|
||||
(cd "$TRASH_DIRECTORY" && test_cmp ssh-expect ssh-output)
|
||||
|
||||
@@ -13,7 +13,7 @@ test_expect_success setup '
|
||||
|
||||
test_expect_success 'clone calls git upload-pack unqualified with no -u option' '
|
||||
test_must_fail env GIT_SSH=./not_ssh git clone localhost:/path/to/repo junk &&
|
||||
echo "localhost git-upload-pack '\''/path/to/repo'\''" >expected &&
|
||||
echo "localhost git upload-pack '\''/path/to/repo'\''" >expected &&
|
||||
test_cmp expected not_ssh_output
|
||||
'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user