[PATCH] --upload-pack for git-fetch
From: Michal Ostrowski <hidden>
Date: 2016-06-15 22:42:17
Subsystem:
documentation, the rest · Maintainers:
Jonathan Corbet, Linus Torvalds
Implement "git-clone"'s "--upload-pack" parameter in git-fetch, making it available for git-pull. Without this, there is no way to specify a remote executable when invoking git-pull/git-fetch as there is for git-clone. Signed-off-by: Michal Ostrowski <redacted> --- Documentation/fetch-options.txt | 7 +++++++ git-fetch.sh | 8 +++++++- 2 files changed, 14 insertions(+), 1 deletions(-) 0b6314bc51945c2ce1e4c8627a00779c23bef3e1
diff --git a/Documentation/fetch-options.txt b/Documentation/fetch-options.txt
index e624d3d..8323756 100644
--- a/Documentation/fetch-options.txt
+++ b/Documentation/fetch-options.txt@@ -3,6 +3,13 @@ existing contents of `.git/FETCH_HEAD`. Without this option old data in `.git/FETCH_HEAD` will be overwritten. +--upload-pack <upload-pack>:: +-u <upload-pack>:: + When given, and the repository to fetch from is handled + by 'git-fetch-pack', '--exec=<upload-pack>' is passed to + the command to specify non-default path for the command + run on the other end. + -f, \--force:: When `git-fetch` is used with `<rbranch>:<lbranch>` refspec, it refuses to update the local branch
diff --git a/git-fetch.sh b/git-fetch.sh
index 4a0cb32..d1659e2 100755
--- a/git-fetch.sh
+++ b/git-fetch.sh@@ -17,12 +17,18 @@ append= force= verbose= update_head_ok= +exec= while case "$#" in 0) break ;; esac do case "$1" in -a|--a|--ap|--app|--appe|--appen|--append) append=t ;; + -u|--u|--up|--upl|--uploa|--upload|--upload-|--upload-p|--upload-pa|\ + --upload-pac|--upload-pack) + shift + exec="--exec=$1" + ;; -f|--f|--fo|--for|--forc|--force) force=t ;;
@@ -312,7 +318,7 @@ fetch_main () { ( : subshell because we muck with IFS IFS=" $LF" ( - git-fetch-pack $keep "$remote" $rref || echo failed "$remote" + git-fetch-pack $exec $keep "$remote" $rref || echo failed "$remote" ) | while read sha1 remote_name do
--
1.1.4.ge755-dirty