]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'fp/t3310-unhide-git-failures'
authorJunio C Hamano <gitster@pobox.com>
Mon, 16 Mar 2026 17:48:14 +0000 (10:48 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 16 Mar 2026 17:48:14 +0000 (10:48 -0700)
The construct 'test "$(command)" = expectation' loses the exit
status from the command, which has been fixed by breaking up the
statement into pieces.

* fp/t3310-unhide-git-failures:
  t3310: avoid hiding failures from rev-parse in command substitutions

1  2 
t/t3310-notes-merge-manual-resolve.sh

index f0054b0a39c54101909468e3dbee90380a828148,8e3e71bb0953a96e6a76616dc964fe2f268fc02a..0bb366fdb8fce1139f5c89a510ae1595eaf5b146
@@@ -564,18 -573,20 +573,20 @@@ EO
        # NOTES_MERGE_* refs and .git/NOTES_MERGE_* state files must remain
        git rev-parse --verify NOTES_MERGE_PARTIAL &&
        git rev-parse --verify NOTES_MERGE_REF &&
 -      test -f .git/NOTES_MERGE_WORKTREE/$commit_sha1 &&
 -      test -f .git/NOTES_MERGE_WORKTREE/$commit_sha2 &&
 -      test -f .git/NOTES_MERGE_WORKTREE/$commit_sha3 &&
 -      test -f .git/NOTES_MERGE_WORKTREE/$commit_sha4 &&
 +      test_path_is_file .git/NOTES_MERGE_WORKTREE/$commit_sha1 &&
 +      test_path_is_file .git/NOTES_MERGE_WORKTREE/$commit_sha2 &&
 +      test_path_is_file .git/NOTES_MERGE_WORKTREE/$commit_sha3 &&
 +      test_path_is_file .git/NOTES_MERGE_WORKTREE/$commit_sha4 &&
        # Refs are unchanged
-       test "$(git rev-parse refs/notes/m)" = "$(git rev-parse refs/notes/w)" &&
-       test "$(git rev-parse refs/notes/y)" = "$(git rev-parse NOTES_MERGE_PARTIAL^1)" &&
-       test "$(git rev-parse refs/notes/m)" != "$(git rev-parse NOTES_MERGE_PARTIAL^1)" &&
+       test_cmp_rev refs/notes/m refs/notes/w &&
+       test_cmp_rev refs/notes/y NOTES_MERGE_PARTIAL^1 &&
+       test_cmp_rev ! refs/notes/m NOTES_MERGE_PARTIAL^1 &&
        # Mention refs/notes/m, and its current and expected value in output
        test_grep -q "refs/notes/m" output &&
-       test_grep -q "$(git rev-parse refs/notes/m)" output &&
-       test_grep -q "$(git rev-parse NOTES_MERGE_PARTIAL^1)" output &&
+       oid=$(git rev-parse refs/notes/m) &&
+       test_grep -q "$oid" output &&
+       oid=$(git rev-parse NOTES_MERGE_PARTIAL^1) &&
+       test_grep -q "$oid" output &&
        # Verify that other notes refs has not changed (w, x, y and z)
        verify_notes w &&
        verify_notes x &&