summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2009-05-23 01:44:00 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2009-05-23 01:44:00 -0700
commitc9a88deede2e3438a70be7df233678d6a0fece74 (patch)
tree2abe2481fb9d9e84cda22452d779b3dd7f8c4593
parentMerge branch 'fc/decorate-tag' (diff)
parentFix behavior with non-commit upstream references (diff)
downloadtgif-c9a88deede2e3438a70be7df233678d6a0fece74.tar.xz
Merge branch 'mg/track'
* mg/track: Fix behavior with non-commit upstream references Test tracking of non-commit upstreams
-rw-r--r--remote.c4
-rwxr-xr-xt/t6040-tracking-info.sh14
2 files changed, 16 insertions, 2 deletions
diff --git a/remote.c b/remote.c
index d66e2f3c93..2c3e9053a4 100644
--- a/remote.c
+++ b/remote.c
@@ -1399,13 +1399,13 @@ int stat_tracking_info(struct branch *branch, int *num_ours, int *num_theirs)
base = branch->merge[0]->dst;
if (!resolve_ref(base, sha1, 1, NULL))
return 0;
- theirs = lookup_commit(sha1);
+ theirs = lookup_commit_reference(sha1);
if (!theirs)
return 0;
if (!resolve_ref(branch->refname, sha1, 1, NULL))
return 0;
- ours = lookup_commit(sha1);
+ ours = lookup_commit_reference(sha1);
if (!ours)
return 0;
diff --git a/t/t6040-tracking-info.sh b/t/t6040-tracking-info.sh
index 3d6db4d386..00e1de9627 100755
--- a/t/t6040-tracking-info.sh
+++ b/t/t6040-tracking-info.sh
@@ -74,5 +74,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_success '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