File tree Expand file tree Collapse file tree 3 files changed +20
-1
lines changed Expand file tree Collapse file tree 3 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -563,6 +563,11 @@ library for your script to use.
563
563
argument. This is primarily meant for use during the
564
564
development of a new test script.
565
565
566
+ - debug <git-command>
567
+
568
+ Run a git command inside a debugger. This is primarily meant for
569
+ use when debugging a failing test script.
570
+
566
571
- test_done
567
572
568
573
Your test script must have test_done at the end. Its purpose
Original file line number Diff line number Diff line change @@ -145,6 +145,14 @@ test_pause () {
145
145
fi
146
146
}
147
147
148
+ # Wrap git in gdb. Adding this to a command can make it easier to
149
+ # understand what is going on in a failing test.
150
+ #
151
+ # Example: "debug git checkout master".
152
+ debug () {
153
+ GIT_TEST_GDB=1 " $@ "
154
+ }
155
+
148
156
# Call test_commit with the arguments "<message> [<file> [<contents> [<tag>]]]"
149
157
#
150
158
# This will commit a file with the given contents and the given commit
Original file line number Diff line number Diff line change @@ -19,4 +19,10 @@ GIT_TEXTDOMAINDIR='@@BUILD_DIR@@/po/build/locale'
19
19
PATH=' @@BUILD_DIR@@/bin-wrappers:' " $PATH "
20
20
export GIT_EXEC_PATH GITPERLLIB PATH GIT_TEXTDOMAINDIR
21
21
22
- exec " ${GIT_EXEC_PATH} /@@PROG@@" " $@ "
22
+ if test -n " $GIT_TEST_GDB "
23
+ then
24
+ unset GIT_TEST_GDB
25
+ exec gdb --args " ${GIT_EXEC_PATH} /@@PROG@@" " $@ "
26
+ else
27
+ exec " ${GIT_EXEC_PATH} /@@PROG@@" " $@ "
28
+ fi
You can’t perform that action at this time.
0 commit comments