@@ -26,6 +26,9 @@ test_expect_success 'setup' '
26
26
cat >key_exit_code_129 <<-\EOF &&
27
27
"exit_code":129
28
28
EOF
29
+ cat >key_detail <<-\EOF &&
30
+ "event":"detail"
31
+ EOF
29
32
git config --local slog.pretty false &&
30
33
git config --local slog.path "$LOGFILE"
31
34
'
@@ -221,4 +224,40 @@ test_expect_success PERLJSON 'turn on aux-data, verify a few fields' '
221
224
grep "row\[0\]\.aux\.index\[.*\]\[0\] sparse_checkout_count" <parsed_exit
222
225
'
223
226
227
+ test_expect_success PERLJSON ' verify child start/end events during clone' '
228
+ test_when_finished "rm \"$LOGFILE\" event_exit" &&
229
+ git config --local slog.aux false &&
230
+ git config --local slog.detail false &&
231
+ git config --local slog.timers false &&
232
+ rm -f "$LOGFILE" &&
233
+
234
+ # Clone seems to read the config after it switches to the target repo
235
+ # rather than the source repo, so we have to explicitly set the config
236
+ # settings on the command line.
237
+ git -c slog.path="$LOGFILE" -c slog.detail=true clone . ./clone1 &&
238
+
239
+ grep -f key_cmd_exit "$LOGFILE" >event_exit &&
240
+ grep -f key_detail "$LOGFILE" >event_detail &&
241
+
242
+ perl "$TEST_DIRECTORY"/t0420/parse_json.perl <event_exit >parsed_exit &&
243
+ perl "$TEST_DIRECTORY"/t0420/parse_json.perl <event_detail >parsed_detail &&
244
+
245
+ grep "row\[0\]\.event cmd_exit" <parsed_exit &&
246
+ grep "row\[0\]\.result\.exit_code 0" <parsed_exit &&
247
+ grep "row\[0\]\.command upload-pack" <parsed_exit &&
248
+
249
+ grep "row\[1\]\.event cmd_exit" <parsed_exit &&
250
+ grep "row\[1\]\.result\.exit_code 0" <parsed_exit &&
251
+ grep "row\[1\]\.command clone" <parsed_exit &&
252
+
253
+ grep "row\[0\]\.detail\.label child_starting" <parsed_detail &&
254
+ grep "row\[0\]\.detail\.data\.child_id 0" <parsed_detail &&
255
+ grep "row\[0\]\.detail\.data\.child_argv\[0\] git-upload-pack" <parsed_detail &&
256
+
257
+ grep "row\[1\]\.detail\.label child_ended" <parsed_detail &&
258
+ grep "row\[1\]\.detail\.data\.child_id 0" <parsed_detail &&
259
+ grep "row\[1\]\.detail\.data\.child_argv\[0\] git-upload-pack" <parsed_detail &&
260
+ grep "row\[1\]\.detail\.data\.child_exit_code 0" <parsed_detail
261
+ '
262
+
224
263
test_done
0 commit comments