diff options
author | Michael J Gruber <git@grubix.eu> | 2017-09-07 16:02:21 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-09-08 10:37:24 +0900 |
commit | a24fa652962007e03ac02e25952bf45ddff5bfde (patch) | |
tree | f37d9fea57657cbc7dd0b5162695fd9994e82c63 | |
parent | 4db464f815a38c7d9feee5db883f78216002ae3d (diff) | |
download | git-a24fa652962007e03ac02e25952bf45ddff5bfde.tar.gz git-a24fa652962007e03ac02e25952bf45ddff5bfde.tar.xz |
t6120: test name-rev --all and --stdin
name-rev is used in a few tests, but tested only in t6120 along with
describe so far.
Add tests for name-rev with --all and --stdin.
Signed-off-by: Michael J Gruber <git@grubix.eu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-x | t/t6120-describe.sh | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/t/t6120-describe.sh b/t/t6120-describe.sh index aa74eb8f0..7c5728ebd 100755 --- a/t/t6120-describe.sh +++ b/t/t6120-describe.sh @@ -198,6 +198,31 @@ test_expect_success 'name-rev with exact tags' ' test_cmp expect actual ' +test_expect_success 'name-rev --all' ' + >expect.unsorted && + for rev in $(git rev-list --all) + do + git name-rev $rev >>expect.unsorted + done && + sort <expect.unsorted >expect && + git name-rev --all >actual.unsorted && + sort <actual.unsorted >actual && + test_cmp expect actual +' + +test_expect_success 'name-rev --stdin' ' + >expect.unsorted && + for rev in $(git rev-list --all) + do + name=$(git name-rev --name-only $rev) && + echo "$rev ($name)" >>expect.unsorted + done && + sort <expect.unsorted >expect && + git rev-list --all | git name-rev --stdin >actual.unsorted && + sort <actual.unsorted >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) && |