Skip to content

Commit 15da753

Browse files
szedergitster
authored andcommitted
t7501-commit: drop silly command substitution
The test '--dry-run with conflicts fixed from a merge' in 't7501-commit.sh', added in 8dc874b (wt-status.c: set commitable bit if there is a meaningful merge., 2016-02-15), runs the following unnecessary and downright bogus command substitution: ! $(git merge --no-commit commit-1) && I.e. after 'git merge ...' is executed and expectedly fails, the test attempts to execute its output: Merging: 80f2ea2 commit 2 virtual commit-1 found 1 common ancestor: e60d113 Initial commit Auto-merging test-file CONFLICT (content): Merge conflict in test-file Automatic merge failed; fix conflicts and then commit the result. as a command, which most likely fails, because there is no such command as "Merging:". Then '!' negates the failed exit status, the test continues, and eventually succeeds. Remove this command substitution and use 'test_must_fail' to ensure that 'git merge' fails. Signed-off-by: SZEDER Gábor <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 8dc874b commit 15da753

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

t/t7501-commit.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ test_expect_success '--dry-run with conflicts fixed from a merge' '
600600
git checkout -b branch-2 HEAD^1 &&
601601
echo "commit-2-state" >test-file &&
602602
git commit -m "commit 2" -i test-file &&
603-
! $(git merge --no-commit commit-1) &&
603+
test_must_fail git merge --no-commit commit-1 &&
604604
echo "commit-2-state" >test-file &&
605605
git add test-file &&
606606
git commit --dry-run &&

0 commit comments

Comments
 (0)