git-{fetch,peek-remote} handling of --upload-pack
git-peek-remote needs to handle a -u|--upload-pack parameter just like git-fetch (and git-fetch has to pass it on to git-peek-remote). (This is actually a follow-up to my previous git-fetch patch.) Signed-off-by: Michal Ostrowski <mostrows@heater.watson.ibm.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
Michal Ostrowski committed
Jan 20, 2006 at 13:38 UTC
96b086d6181067e9c76f543aaddfc7fcfd02649c
2 files changed
+13
-4
git-fetch.sh
+4
-2
@@ -18,6 +18,7 @@ force=
18
verbose=
19
update_head_ok=
20
exec=
21
+upload_pack=
22
while case "$#" in 0) break ;; esac
23
do
24
case "$1" in
@@ -28,6 +29,7 @@ do
29
--upload-pac|--upload-pack)
30
shift
31
exec="--exec=$1"
32
+ upload_pack="-u $1"
33
;;
34
-f|--f|--fo|--for|--forc|--force)
35
force=t
@@ -202,7 +204,7 @@ reflist=$(get_remote_refs_for_fetch "$@")
204
if test "$tags"
205
then
206
taglist=$(IFS=" " &&
205
- git-ls-remote --tags "$remote" |
207
+ git-ls-remote $upload_pack --tags "$remote" |
208
while read sha1 name
209
do
210
case "$name" in
@@ -367,7 +369,7 @@ fetch_main "$reflist"
369
case "$no_tags$tags" in
370
'')
371
taglist=$(IFS=" " &&
370
- git-ls-remote --tags "$remote" |
372
+ git-ls-remote $upload_pack --tags "$remote" |
373
sed -ne 's|^\([0-9a-f]*\)[ ]\(refs/tags/.*\)^{}$|\1 \2|p' |
374
while read sha1 name
375
do
git-ls-remote.sh
+9
-2
@@ -2,7 +2,8 @@
2
#
3
4
usage () {
5
- echo >&2 "usage: $0 [--heads] [--tags] <repository> <refs>..."
5
+ echo >&2 "usage: $0 [--heads] [--tags] [-u|--upload-pack <upload-pack>]"
6
+ echo >&2 " <repository> <refs>..."
7
exit 1;
8
}
9
@@ -11,6 +12,7 @@ die () {
12
exit 1
13
}
14
15
+exec=
16
while case "$#" in 0) break;; esac
17
do
18
case "$1" in
@@ -18,6 +20,11 @@ do
20
heads=heads; shift ;;
21
-t|--t|--ta|--tag|--tags)
22
tags=tags; shift ;;
23
+ -u|--u|--up|--upl|--uploa|--upload|--upload-|--upload-p|--upload-pa|\
24
+ --upload-pac|--upload-pack)
25
+ shift
26
+ exec="--exec=$1"
27
+ shift;;
28
--)
29
shift; break ;;
30
-*)
@@ -66,7 +73,7 @@ rsync://* )
73
;;
74
75
* )
69
- git-peek-remote "$peek_repo" ||
76
+ git-peek-remote $exec "$peek_repo" ||
77
echo "failed slurping"
78
;;
79
esac |