Skip to content

Commit a7bf21c

Browse files
committed
Facilitate debugging Git executables in tests with gdb
When prefixing a Git call in the test suite with 'TEST_GDB_GIT=1 ', it will now be run with GDB, allowing the developer to debug test failures more conveniently. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 40f4760 commit a7bf21c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

wrap-for-bin.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,11 @@ GIT_TEXTDOMAINDIR='@@BUILD_DIR@@/po/build/locale'
1919
PATH='@@BUILD_DIR@@/bin-wrappers:'"$PATH"
2020
export GIT_EXEC_PATH GITPERLLIB PATH GIT_TEXTDOMAINDIR
2121

22+
if test -n "$TEST_GDB_GIT"
23+
then
24+
exec gdb -args "${GIT_EXEC_PATH}/@@PROG@@" "$@"
25+
echo "Could not run gdb -args ${GIT_EXEC_PATH}/@@PROG@@ $*" >&2
26+
exit 1
27+
fi
28+
2229
exec "${GIT_EXEC_PATH}/@@PROG@@" "$@"

0 commit comments

Comments
 (0)