Skip to content

Commit 1be570f

Browse files
Michael J Grubergitster
authored andcommitted
Test tracking of non-commit upstreams
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a95148d commit 1be570f

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

t/t6040-tracking-info.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,19 @@ test_expect_success 'status' '
6666
grep "have 1 and 1 different" actual
6767
'
6868

69+
test_expect_success 'status when tracking lightweight tags' '
70+
git checkout master &&
71+
git tag light &&
72+
git branch --track lighttrack light >actual &&
73+
grep "set up to track" actual &&
74+
git checkout lighttrack
75+
'
6976

77+
test_expect_failure 'status when tracking annotated tags' '
78+
git checkout master &&
79+
git tag -m heavy heavy &&
80+
git branch --track heavytrack heavy >actual &&
81+
grep "set up to track" actual &&
82+
git checkout heavytrack
83+
'
7084
test_done

0 commit comments

Comments
 (0)