Skip to content

Commit f4b98e1

Browse files
rybakgitster
authored andcommitted
t1010: don't create unused files
Builtin "git mktree" writes the the object name of the tree object built to the standard output. Tests 'mktree refuses to read ls-tree -r output (1)' and 'mktree refuses to read ls-tree -r output (2)' in "t1010-mktree.sh" redirect output of "git mktree" to a file, but don't use its contents in assertions. Don't redirect output of "git mktree" to file "actual" in tests that assert that an invocation of "git mktree" must fail. Output of "git mktree" is empty when it refuses to build a tree object. So, alternatively, the test could assert that the output is empty. However, there isn't a good reason for the user to expect the command to be silent in such cases, so we shouldn't enforce it. The user shouldn't use the output of a failing command anyway. Signed-off-by: Andrei Rybak <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 4e27336 commit f4b98e1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

t/t1010-mktree.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,11 @@ 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
6464
'
6565

6666
test_expect_success 'mktree refuses to read ls-tree -r output (2)' '
67-
test_must_fail git mktree <all.withsub >actual
67+
test_must_fail git mktree <all.withsub
6868
'
6969

7070
test_done

0 commit comments

Comments
 (0)