diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2023-02-07 01:44:33 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-02-07 02:30:42 +0300 |
commit | 9fdc79ecba0f4a3ef885f1409d2db5a1dbabd649 (patch) | |
tree | 20e4441cb3fecb298f8e6ee407b6c0641a41eb39 /t/t7516-commit-races.sh | |
parent | 4bd0785dc2eb7b3f23d25c8013337cc51ab1065d (diff) |
tests: don't lose misc "git" exit codes
Fix a few miscellaneous cases where:
- We lost the "git" exit code via "git ... | grep"
- Likewise by having a $(git) argument to git itself
- Used "test -z" to check that a command emitted no output, we can use
"test_must_be_empty" and &&-chaining instead.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7516-commit-races.sh')
-rwxr-xr-x | t/t7516-commit-races.sh | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/t/t7516-commit-races.sh b/t/t7516-commit-races.sh index f2ce14e907..2d38a16480 100755 --- a/t/t7516-commit-races.sh +++ b/t/t7516-commit-races.sh @@ -10,7 +10,8 @@ test_expect_success 'race to create orphan commit' ' test_must_fail env EDITOR=./hare-editor git commit --allow-empty -m tortoise -e && git show -s --pretty=format:%s >subject && grep hare subject && - test -z "$(git show -s --pretty=format:%P)" + git show -s --pretty=format:%P >out && + test_must_be_empty out ' test_expect_success 'race to create non-orphan commit' ' |