diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-07-22 11:24:19 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-07-22 11:24:19 -0700 |
commit | 3daafe9403c65b39f133f3aa4a6dbbcd372e9db1 (patch) | |
tree | e965990c514eb8c415017c399d96cdc16b2913f2 /t | |
parent | 07b83b5d98a8b7230f3ebafeb4ecf2916c011db9 (diff) | |
parent | adfc1857bdb090786fd9d22c1acec39371c76048 (diff) | |
download | git-3daafe9403c65b39f133f3aa4a6dbbcd372e9db1.tar.gz |
Merge branch 'jc/name-rev-exact-ref'
Corrects the longstanding sloppiness in the implementation of
name-rev that conflated "we take commit-ish" and "differences
between tags and commits do not matter".
* jc/name-rev-exact-ref:
describe: fix --contains when a tag is given as input
name-rev: differentiate between tags and commits they point at
describe: use argv-array
name-rev: allow converting the exact object name at the tip of a ref
name-ref: factor out name shortening logic from name_ref()
Diffstat (limited to 't')
-rwxr-xr-x | t/t6120-describe.sh | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/t/t6120-describe.sh b/t/t6120-describe.sh index a25729f2a7..c0e5b2a627 100755 --- a/t/t6120-describe.sh +++ b/t/t6120-describe.sh @@ -174,4 +174,28 @@ check_describe "test2-lightweight-*" --tags --match="test2-*" check_describe "test2-lightweight-*" --long --tags --match="test2-*" HEAD^ +test_expect_success 'name-rev with exact tags' ' + echo A >expect && + tag_object=$(git rev-parse refs/tags/A) && + git name-rev --tags --name-only $tag_object >actual && + test_cmp expect actual && + + echo "A^0" >expect && + tagged_commit=$(git rev-parse "refs/tags/A^0") && + git name-rev --tags --name-only $tagged_commit >actual && + test_cmp expect actual +' + +test_expect_success 'describe --contains with the exact tags' ' + echo "A^0" >expect && + tag_object=$(git rev-parse refs/tags/A) && + git describe --contains $tag_object >actual && + test_cmp expect actual && + + echo "A^0" >expect && + tagged_commit=$(git rev-parse "refs/tags/A^0") && + git describe --contains $tagged_commit >actual && + test_cmp expect actual +' + test_done |