]> asedeno.scripts.mit.edu Git - git.git/commitdiff
make --upload-pack option to git-fetch configurable
authorUwe Kleine-König <ukleinek@informatik.uni-freiburg.de>
Thu, 25 Jan 2007 04:45:39 +0000 (05:45 +0100)
committerJunio C Hamano <junkio@cox.net>
Thu, 25 Jan 2007 07:06:30 +0000 (23:06 -0800)
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>
Documentation/config.txt
git-fetch.sh
git-parse-remote.sh

index 8086d753683f3b6a2eec49e51af0ed2f1c864619..3f2fa09a87b0cbfb517591ff0472b1ff5cd81ef8 100644 (file)
@@ -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.
index 07a1d05ac7a30b08355f330f5300492ac5afb790..61c8cf477384fbcaa125f4a90883257492f98710 100755 (executable)
@@ -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=
index 4fc602082b23c695211b4333469ae0dce1a33727..1122c8389ddb3ba860eae62483c8c55603321a20 100755 (executable)
@@ -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
+}