Skip to content

Commit c593a26

Browse files
szedergitster
authored andcommitted
t6120-describe: modernize the 'check_describe' helper
The 'check_describe' helper function runs 'git describe' outside of 'test_expect_success' blocks, with extra hand-rolled code to record and examine its exit code. Update this helper and move the 'git describe' invocation inside the 'test_expect_success' block. Signed-off-by: SZEDER Gábor <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d91ce88 commit c593a26

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

t/t6120-describe.sh

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,12 @@ test_description='test describe'
1616
check_describe () {
1717
expect="$1"
1818
shift
19-
R=$(git describe "$@" 2>err.actual)
20-
S=$?
21-
cat err.actual >&3
22-
test_expect_success "describe $*" '
23-
test $S = 0 &&
19+
describe_opts="$@"
20+
test_expect_success "describe $describe_opts" '
21+
R=$(git describe $describe_opts 2>err.actual) &&
2422
case "$R" in
2523
$expect) echo happy ;;
26-
*) echo "Oops - $R is not $expect";
24+
*) echo "Oops - $R is not $expect" &&
2725
false ;;
2826
esac
2927
'

0 commit comments

Comments
 (0)