@matheusbsbs / matheus-bagliano / commits / 5dee29ac0f
Fork 0

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>

Uwe Kleine-König committed Jan 25, 2007 at 05:45 UTC 5dee29ac0fc95999a42c5cbac767724a9ff73cfa
3 files changed +24 -1
Documentation/config.txt
+5 -1
@@ -429,9 +429,13 @@ remote.<name>.push::
429 gitlink:git-push[1].
430
431 remote.<name>.receivepack::
432 - The default program to execute on the remote side when pulling. See
432 + The default program to execute on the remote side when pushing. See
433 option \--exec of gitlink:git-push[1].
434
435 +remote.<name>.uploadpack::
436 + The default program to execute on the remote side when fetching. See
437 + option \--exec of gitlink:git-fetch-pack[1].
438 +
439 repack.usedeltabaseoffset::
440 Allow gitlink:git-repack[1] to create packs that uses
441 delta-base offset. Defaults to false.
git-fetch.sh
+6
@@ -85,6 +85,12 @@ case "$#" in
85 set x $origin ; shift ;;
86 esac
87
88 +if test -z "$exec"
89 +then
90 + # No command line override and we have configuration for the remote.
91 + exec="--upload-pack=$(get_uploadpack $1)"
92 +fi
93 +
94 remote_nick="$1"
95 remote=$(get_remote_url "$@")
96 refs=
git-parse-remote.sh
+13
@@ -279,3 +279,16 @@ resolve_alternates () {
279 esac
280 done
281 }
282 +
283 +get_uploadpack () {
284 + data_source=$(get_data_source "$1")
285 + case "$data_source" in
286 + config)
287 + uplp=$(git-repo-config --get "remote.$1.uploadpack")
288 + echo ${uplp:-git-upload-pack}
289 + ;;
290 + *)
291 + echo "git-upload-pack"
292 + ;;
293 + esac
294 +}