diff options
author | Uwe Kleine-König <ukleinek@informatik.uni-freiburg.de> | 2007-01-25 05:45:39 +0100 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2007-01-24 23:06:30 -0800 |
commit | 5dee29ac0fc95999a42c5cbac767724a9ff73cfa (patch) | |
tree | 657b55a44ddf363f6a9540b0b4e5eb900ab99bc1 | |
parent | e28714c527339a477fca226765163b9361d94285 (diff) | |
download | git-5dee29ac0fc95999a42c5cbac767724a9ff73cfa.tar.gz git-5dee29ac0fc95999a42c5cbac767724a9ff73cfa.tar.xz |
make --upload-pack option to git-fetch configurable
This introduces the config item remote.<name>.uploadpack to override the
default value (which is "git-upload-pack").
Signed-off-by: Uwe Kleine-König <ukleinek@informatik.uni-freiburg.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
-rw-r--r-- | Documentation/config.txt | 6 | ||||
-rwxr-xr-x | git-fetch.sh | 6 | ||||
-rwxr-xr-x | git-parse-remote.sh | 13 |
3 files changed, 24 insertions, 1 deletions
diff --git a/Documentation/config.txt b/Documentation/config.txt index 8086d7536..3f2fa09a8 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -429,9 +429,13 @@ remote.<name>.push:: gitlink:git-push[1]. remote.<name>.receivepack:: - The default program to execute on the remote side when pulling. See + The default program to execute on the remote side when pushing. See option \--exec of gitlink:git-push[1]. +remote.<name>.uploadpack:: + The default program to execute on the remote side when fetching. See + option \--exec of gitlink:git-fetch-pack[1]. + repack.usedeltabaseoffset:: Allow gitlink:git-repack[1] to create packs that uses delta-base offset. Defaults to false. diff --git a/git-fetch.sh b/git-fetch.sh index 07a1d05ac..61c8cf477 100755 --- a/git-fetch.sh +++ b/git-fetch.sh @@ -85,6 +85,12 @@ case "$#" in set x $origin ; shift ;; esac +if test -z "$exec" +then + # No command line override and we have configuration for the remote. + exec="--upload-pack=$(get_uploadpack $1)" +fi + remote_nick="$1" remote=$(get_remote_url "$@") refs= diff --git a/git-parse-remote.sh b/git-parse-remote.sh index 4fc602082..1122c8389 100755 --- a/git-parse-remote.sh +++ b/git-parse-remote.sh @@ -279,3 +279,16 @@ resolve_alternates () { esac done } + +get_uploadpack () { + data_source=$(get_data_source "$1") + case "$data_source" in + config) + uplp=$(git-repo-config --get "remote.$1.uploadpack") + echo ${uplp:-git-upload-pack} + ;; + *) + echo "git-upload-pack" + ;; + esac +} |