@matheusbsbs / matheus-bagliano / commits / 2c620a1ad1
Fork 0

git-fetch: pass --upload-pack to fetch-pack

Without this, there is no way to specify a remote executable when invoking git-pull/git-fetch as there is for git-clone. [jc: I have a mild suspicion that this is a broken environment (aka sysadmin disservice). It may be legal to configure your sshd to spawn named program without involving shell at all, and if your sysadmin does so and you have your git programs under your home directory, you would need something like this, but then I suspect you would need such workaround everywhere, not just git. But we have these options we can use to work around the issue, so there is no strong reason not to reject this patch, either. ] Signed-off-by: Michal Ostrowski <mostrows@watson.ibm.com> Signed-off-by: Junio C Hamano <junkio@cox.net>

Michal Ostrowski committed Jan 20, 2006 at 13:05 UTC 2c620a1ad1dce1e249d66ce18c7b1cce22d5d64c
2 files changed +14 -1
Documentation/fetch-options.txt
+7
@@ -3,6 +3,13 @@
3 existing contents of `.git/FETCH_HEAD`. Without this
4 option old data in `.git/FETCH_HEAD` will be overwritten.
5
6 +--upload-pack <upload-pack>::
7 +-u <upload-pack>::
8 + When given, and the repository to fetch from is handled
9 + by 'git-fetch-pack', '--exec=<upload-pack>' is passed to
10 + the command to specify non-default path for the command
11 + run on the other end.
12 +
13 -f, \--force::
14 When `git-fetch` is used with `<rbranch>:<lbranch>`
15 refspec, it refuses to update the local branch
git-fetch.sh
+7 -1
@@ -17,12 +17,18 @@ append=
17 force=
18 verbose=
19 update_head_ok=
20 +exec=
21 while case "$#" in 0) break ;; esac
22 do
23 case "$1" in
24 -a|--a|--ap|--app|--appe|--appen|--append)
25 append=t
26 ;;
27 + -u|--u|--up|--upl|--uploa|--upload|--upload-|--upload-p|--upload-pa|\
28 + --upload-pac|--upload-pack)
29 + shift
30 + exec="--exec=$1"
31 + ;;
32 -f|--f|--fo|--for|--forc|--force)
33 force=t
34 ;;
@@ -312,7 +318,7 @@ fetch_main () {
318 ( : subshell because we muck with IFS
319 IFS=" $LF"
320 (
315 - git-fetch-pack $keep "$remote" $rref || echo failed "$remote"
321 + git-fetch-pack $exec $keep "$remote" $rref || echo failed "$remote"
322 ) |
323 while read sha1 remote_name
324 do