@matheusbsbs / matheus-bagliano / commits / 6c96c0f194
Fork 0

git-fetch: follow lightweit tags as well.

This side-ports commit fd19f620 from Cogito, in which I fixed exactly the same bug. Somehow nobody noticed this for a long time in git. Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed Nov 18, 2006 at 21:39 UTC 6c96c0f1940b0247530d21b10042d16bf1e7b769
2 files changed +19 -2
git-fetch.sh
+3 -2
@@ -432,10 +432,11 @@ case "$no_tags$tags" in
432 # using local tracking branch.
433 taglist=$(IFS=" " &&
434 git-ls-remote $upload_pack --tags "$remote" |
435 - sed -ne 's|^\([0-9a-f]*\)[ ]\(refs/tags/.*\)^{}$|\1 \2|p' |
435 + sed -n -e 's|^\('"$_x40"'\) \(refs/tags/.*\)^{}$|\1 \2|p' \
436 + -e 's|^\('"$_x40"'\) \(refs/tags/.*\)$|\1 \2|p' |
437 while read sha1 name
438 do
438 - git-show-ref --verify --quiet -- $name && continue
439 + git-show-ref --verify --quiet -- "$name" && continue
440 git-check-ref-format "$name" || {
441 echo >&2 "warning: tag ${name} ignored"
442 continue
t/t5510-fetch.sh
+16
@@ -66,4 +66,20 @@ test_expect_success "fetch test for-merge" '
66 cut -f -2 .git/FETCH_HEAD >actual &&
67 diff expected actual'
68
69 +test_expect_success 'fetch following tags' '
70 +
71 + cd "$D" &&
72 + git tag -a -m 'annotated' anno HEAD &&
73 + git tag light HEAD &&
74 +
75 + mkdir four &&
76 + cd four &&
77 + git init-db &&
78 +
79 + git fetch .. :track &&
80 + git show-ref --verify refs/tags/anno &&
81 + git show-ref --verify refs/tags/light
82 +
83 +'
84 +
85 test_done