Skip to content

Commit a24fa65

Browse files
mjggitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 4db464f commit a24fa65

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

t/t6120-describe.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,31 @@ test_expect_success 'name-rev with exact tags' '
198198
test_cmp expect actual
199199
'
200200

201+
test_expect_success 'name-rev --all' '
202+
>expect.unsorted &&
203+
for rev in $(git rev-list --all)
204+
do
205+
git name-rev $rev >>expect.unsorted
206+
done &&
207+
sort <expect.unsorted >expect &&
208+
git name-rev --all >actual.unsorted &&
209+
sort <actual.unsorted >actual &&
210+
test_cmp expect actual
211+
'
212+
213+
test_expect_success 'name-rev --stdin' '
214+
>expect.unsorted &&
215+
for rev in $(git rev-list --all)
216+
do
217+
name=$(git name-rev --name-only $rev) &&
218+
echo "$rev ($name)" >>expect.unsorted
219+
done &&
220+
sort <expect.unsorted >expect &&
221+
git rev-list --all | git name-rev --stdin >actual.unsorted &&
222+
sort <actual.unsorted >actual &&
223+
test_cmp expect actual
224+
'
225+
201226
test_expect_success 'describe --contains with the exact tags' '
202227
echo "A^0" >expect &&
203228
tag_object=$(git rev-parse refs/tags/A) &&

0 commit comments

Comments
 (0)