]> git.ipfire.org Git - thirdparty/git.git/commit - t/t1507-rev-parse-upstream.sh
t1507: stop losing return codes of git commands
authorDenton Liu <liu.denton@gmail.com>
Fri, 20 Dec 2019 18:16:00 +0000 (10:16 -0800)
committerJunio C Hamano <gitster@pobox.com>
Fri, 20 Dec 2019 19:30:45 +0000 (11:30 -0800)
commit5236fce6b4b597588f5e3955b309195f376a858f
treec62b7bded9a91fccae840d1420e46c5ab57a83b3
parent10812c2337eb04f2857000fd644efdc02247ca92
t1507: stop losing return codes of git commands

The return code of git commands are lost when a command is in a
non-assignment command substitution in favour of the surrounding
command's. Rewrite instances of this so that git commands run
on their own.

In commit_subject(), use a `tformat` instead of `format` since,
previously, we were testing the output of a command substitution which
didn't care if there was a trailing newline since it was automatically
stripped. Since we use test_cmp() now, the trailing newline matters so
use `tformat` to always output it.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t1507-rev-parse-upstream.sh