Browse Source

Merge branch 'mg/track'

* mg/track:
  Fix behavior with non-commit upstream references
  Test tracking of non-commit upstreams
maint
Junio C Hamano 16 years ago
parent
commit
c9a88deede
  1. 4
      remote.c
  2. 14
      t/t6040-tracking-info.sh

4
remote.c

@ -1399,13 +1399,13 @@ int stat_tracking_info(struct branch *branch, int *num_ours, int *num_theirs)
base = branch->merge[0]->dst; base = branch->merge[0]->dst;
if (!resolve_ref(base, sha1, 1, NULL)) if (!resolve_ref(base, sha1, 1, NULL))
return 0; return 0;
theirs = lookup_commit(sha1); theirs = lookup_commit_reference(sha1);
if (!theirs) if (!theirs)
return 0; return 0;


if (!resolve_ref(branch->refname, sha1, 1, NULL)) if (!resolve_ref(branch->refname, sha1, 1, NULL))
return 0; return 0;
ours = lookup_commit(sha1); ours = lookup_commit_reference(sha1);
if (!ours) if (!ours)
return 0; return 0;



14
t/t6040-tracking-info.sh

@ -74,5 +74,19 @@ test_expect_success 'status' '
grep "have 1 and 1 different" actual 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 test_done

Loading…
Cancel
Save