]> git.ipfire.org Git - thirdparty/git.git/commit
t3310: avoid hiding failures from rev-parse in command substitutions
authorFrancesco Paparatto <francescopaparatto@gmail.com>
Sat, 7 Mar 2026 10:36:31 +0000 (11:36 +0100)
committerJunio C Hamano <gitster@pobox.com>
Sun, 8 Mar 2026 06:04:36 +0000 (22:04 -0800)
commitd3edca979a1e916518bc2376e468609ddae2a217
tree0d193cf5655b041159e8237048e6e4cc553e9eee
parent67ad42147a7acc2af6074753ebd03d904476118f
t3310: avoid hiding failures from rev-parse in command substitutions

Running `git` commands inside command substitutions like

    test "$(git rev-parse A)" = "$(git rev-parse B)"

can hide failures from the `git` invocations and provide little
diagnostic information when `test` fails.

Use `test_cmp` when comparing against a stored expected value so
mismatches show both expected and actual output. Use `test_cmp_rev`
when comparing two revisions. These helpers produce clearer failure
output, making it easier to understand what went wrong.

Suggested-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Francesco Paparatto <francescopaparatto@gmail.com>
Reviewed-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t3310-notes-merge-manual-resolve.sh