Skip to content

Commit

Permalink
Test tracking of non-commit upstreams
Browse files Browse the repository at this point in the history
git-checkout and git-branch allow setting up an arbitrary committish as
the upstream reference for --track. In particular, tags are allowed. But
they and git-status barf on non-commit upstreams as soon as they are
asked for trackings stats.

Expose this shortcoming by adding two tests: annotated tags are affected
but lightweight tags are OK.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Michael J Gruber authored and Junio C Hamano committed May 14, 2009
1 parent a95148d commit 1be570f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions t/t6040-tracking-info.sh
Original file line number Diff line number Diff line change
@@ -66,5 +66,19 @@ test_expect_success 'status' '
grep "have 1 and 1 different" actual
'

test_expect_success 'status when tracking lightweight tags' '
git checkout master &&
git tag light &&
git branch --track lighttrack light >actual &&
grep "set up to track" actual &&
git checkout lighttrack
'

test_expect_failure 'status when tracking annotated tags' '
git checkout master &&
git tag -m heavy heavy &&
git branch --track heavytrack heavy >actual &&
grep "set up to track" actual &&
git checkout heavytrack
'
test_done

0 comments on commit 1be570f

Please sign in to comment.