Skip to content

Commit b9995e8

Browse files
committed
Merge branch 'ar/test-cleanup-unused-file-creation' into seen
* ar/test-cleanup-unused-file-creation: t1507: assert output of rev-parse t1404: don't create unused file t1400: assert output of update-ref t1302: don't create unused file t1010: assert empty output of mktree t1006: assert error output of cat-file t1005: assert output of ls-files
2 parents 1c4e373 + 5fb58f6 commit b9995e8

7 files changed

+24
-12
lines changed

t/t1005-read-tree-reset.sh

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ test_expect_success 'reset should remove remnants from a failed merge' '
4141
git ls-files -s &&
4242
read_tree_u_must_succeed --reset -u HEAD &&
4343
git ls-files -s >actual &&
44-
! test -f old
44+
! test -f old &&
45+
test_cmp expect actual
4546
'
4647

4748
test_expect_success 'two-way reset should remove remnants too' '
@@ -56,7 +57,8 @@ test_expect_success 'two-way reset should remove remnants too' '
5657
git ls-files -s &&
5758
read_tree_u_must_succeed --reset -u HEAD HEAD &&
5859
git ls-files -s >actual &&
59-
! test -f old
60+
! test -f old &&
61+
test_cmp expect actual
6062
'
6163

6264
test_expect_success 'Porcelain reset should remove remnants too' '
@@ -71,7 +73,8 @@ test_expect_success 'Porcelain reset should remove remnants too' '
7173
git ls-files -s &&
7274
git reset --hard &&
7375
git ls-files -s >actual &&
74-
! test -f old
76+
! test -f old &&
77+
test_cmp expect actual
7578
'
7679

7780
test_expect_success 'Porcelain checkout -f should remove remnants too' '
@@ -86,7 +89,8 @@ test_expect_success 'Porcelain checkout -f should remove remnants too' '
8689
git ls-files -s &&
8790
git checkout -f &&
8891
git ls-files -s >actual &&
89-
! test -f old
92+
! test -f old &&
93+
test_cmp expect actual
9094
'
9195

9296
test_expect_success 'Porcelain checkout -f HEAD should remove remnants too' '
@@ -101,7 +105,8 @@ test_expect_success 'Porcelain checkout -f HEAD should remove remnants too' '
101105
git ls-files -s &&
102106
git checkout -f HEAD &&
103107
git ls-files -s >actual &&
104-
! test -f old
108+
! test -f old &&
109+
test_cmp expect actual
105110
'
106111

107112
test_done

t/t1006-cat-file.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,8 @@ do
603603
fatal: Not a valid object name $(test_oid deadbeef_short)
604604
EOF
605605
test_must_fail git cat-file $arg1 $arg2 $(test_oid deadbeef_short) >out 2>err.actual &&
606-
test_must_be_empty out
606+
test_must_be_empty out &&
607+
test_cmp expect.err err.actual
607608
'
608609

609610
test_expect_success "cat-file $arg1 $arg2 error on missing full OID" '

t/t1010-mktree.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,13 @@ test_expect_success 'allow missing object with --missing' '
6060
'
6161

6262
test_expect_success 'mktree refuses to read ls-tree -r output (1)' '
63-
test_must_fail git mktree <all >actual
63+
test_must_fail git mktree <all >actual &&
64+
test_must_be_empty actual
6465
'
6566

6667
test_expect_success 'mktree refuses to read ls-tree -r output (2)' '
67-
test_must_fail git mktree <all.withsub >actual
68+
test_must_fail git mktree <all.withsub >actual &&
69+
test_must_be_empty actual
6870
'
6971

7072
test_done

t/t1302-repo-version.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ test_expect_success 'gitdir selection on normal repos' '
3737

3838
test_expect_success 'gitdir selection on unsupported repo' '
3939
# Make sure it would stop at test2, not trash
40-
test_expect_code 1 git -C test2 config core.repositoryformatversion >actual
40+
test_expect_code 1 git -C test2 config core.repositoryformatversion
4141
'
4242

4343
test_expect_success 'gitdir not required mode' '

t/t1400-update-ref.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1568,6 +1568,7 @@ test_expect_success 'transaction can create and delete' '
15681568
EOF
15691569
git update-ref --stdin <stdin >actual &&
15701570
printf "%s: ok\n" start commit start commit >expect &&
1571+
test_cmp expect actual &&
15711572
test_must_fail git show-ref --verify refs/heads/create-and-delete
15721573
'
15731574

@@ -1595,6 +1596,8 @@ test_expect_success 'transaction cannot restart ongoing transaction' '
15951596
commit
15961597
EOF
15971598
test_must_fail git update-ref --stdin <stdin >actual &&
1599+
printf "%s: ok\n" start >expect &&
1600+
test_cmp expect actual &&
15981601
test_must_fail git show-ref --verify refs/heads/restart
15991602
'
16001603

t/t1404-update-ref-errors.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,6 @@ test_expect_success REFFILES 'no bogus intermediate values during delete' '
551551
git update-ref $prefix/foo $C &&
552552
git pack-refs --all &&
553553
git update-ref $prefix/foo $D &&
554-
git for-each-ref $prefix >unchanged &&
555554
# Now try to update the reference, but hold the `packed-refs` lock
556555
# for a while to see what happens while the process is blocked:
557556
: >.git/packed-refs.lock &&

t/t1507-rev-parse-upstream.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,15 +258,17 @@ test_expect_success '@{reflog}-parsing does not look beyond colon' '
258258
git add @{yesterday} &&
259259
git commit -m "funny reflog file" &&
260260
git hash-object @{yesterday} >expect &&
261-
git rev-parse HEAD:@{yesterday} >actual
261+
git rev-parse HEAD:@{yesterday} >actual &&
262+
test_cmp expect actual
262263
'
263264

264265
test_expect_success '@{upstream}-parsing does not look beyond colon' '
265266
echo content >@{upstream} &&
266267
git add @{upstream} &&
267268
git commit -m "funny upstream file" &&
268269
git hash-object @{upstream} >expect &&
269-
git rev-parse HEAD:@{upstream} >actual
270+
git rev-parse HEAD:@{upstream} >actual &&
271+
test_cmp expect actual
270272
'
271273

272274
test_done

0 commit comments

Comments
 (0)