summaryrefslogtreecommitdiff
path: root/git-fetch.sh
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-02-22 16:15:42 -0800
committerJunio C Hamano <junkio@cox.net>2006-02-22 16:15:42 -0800
commit2cf3be1d31b322cf45640f3019a32d19a8a9b6f8 (patch)
tree8b9fbe8932bac19c0728f144e3314871703b9456 /git-fetch.sh
parentd27d5b3c5b97ca30dfc5c448dc8cdae914131051 (diff)
parent6dc78e696b8597204b903073da932fc5ed0f419e (diff)
downloadgit-2cf3be1d31b322cf45640f3019a32d19a8a9b6f8.tar.gz
Merge fixes up to GIT 1.2.3
Diffstat (limited to 'git-fetch.sh')
-rwxr-xr-xgit-fetch.sh33
1 files changed, 19 insertions, 14 deletions
diff --git a/git-fetch.sh b/git-fetch.sh
index b4325d9d98..fcc24f85c3 100755
--- a/git-fetch.sh
+++ b/git-fetch.sh
@@ -368,20 +368,25 @@ fetch_main "$reflist"
# automated tag following
case "$no_tags$tags" in
'')
- taglist=$(IFS=" " &&
- git-ls-remote $upload_pack --tags "$remote" |
- sed -ne 's|^\([0-9a-f]*\)[ ]\(refs/tags/.*\)^{}$|\1 \2|p' |
- while read sha1 name
- do
- test -f "$GIT_DIR/$name" && continue
- git-check-ref-format "$name" || {
- echo >&2 "warning: tag ${name} ignored"
- continue
- }
- git-cat-file -t "$sha1" >/dev/null 2>&1 || continue
- echo >&2 "Auto-following $name"
- echo ".${name}:${name}"
- done)
+ case "$reflist" in
+ *:refs/*)
+ # effective only when we are following remote branch
+ # using local tracking branch.
+ taglist=$(IFS=" " &&
+ git-ls-remote $upload_pack --tags "$remote" |
+ sed -ne 's|^\([0-9a-f]*\)[ ]\(refs/tags/.*\)^{}$|\1 \2|p' |
+ while read sha1 name
+ do
+ test -f "$GIT_DIR/$name" && continue
+ git-check-ref-format "$name" || {
+ echo >&2 "warning: tag ${name} ignored"
+ continue
+ }
+ git-cat-file -t "$sha1" >/dev/null 2>&1 || continue
+ echo >&2 "Auto-following $name"
+ echo ".${name}:${name}"
+ done)
+ esac
case "$taglist" in
'') ;;
?*)