Skip to content

Commit c48ff0d

Browse files
jeffhostetlerderrickstolee
authored andcommitted
t7524: add test for verbose status deserialzation
Verify that `git status --deserialize=x -v` does not crash and generates the same output as a normal (scanning) status command. These issues are described in the previous 2 commits. Signed-off-by: Jeff Hostetler <[email protected]>
1 parent a25606c commit c48ff0d

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

t/t7524-serialized-status.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,4 +387,43 @@ EOF
387387
388388
'
389389

390+
test_expect_success 'ensure deserialize -v does not crash' '
391+
392+
git init verbose_test &&
393+
touch verbose_test/a &&
394+
touch verbose_test/b &&
395+
touch verbose_test/c &&
396+
git -C verbose_test add a b c &&
397+
git -C verbose_test commit -m abc &&
398+
399+
echo green >>verbose_test/a &&
400+
git -C verbose_test add a &&
401+
echo red_1 >>verbose_test/b &&
402+
echo red_2 >verbose_test/dirt &&
403+
404+
git -C verbose_test status >output.ref &&
405+
git -C verbose_test status -v >output.ref_v &&
406+
407+
git -C verbose_test --no-optional-locks status --serialize=../verbose_test.dat >output.ser.long &&
408+
git -C verbose_test --no-optional-locks status --serialize=../verbose_test.dat_v -v >output.ser.long_v &&
409+
410+
# Verify that serialization does not affect the status output itself.
411+
test_i18ncmp output.ref output.ser.long &&
412+
test_i18ncmp output.ref_v output.ser.long_v &&
413+
414+
GIT_TRACE2_PERF="$(pwd)"/verbose_test.log \
415+
git -C verbose_test status --deserialize=../verbose_test.dat >output.des.long &&
416+
417+
# Verify that normal deserialize was actually used and produces the same result.
418+
test_i18ncmp output.ser.long output.des.long &&
419+
grep -q "deserialize/result:ok" verbose_test.log &&
420+
421+
GIT_TRACE2_PERF="$(pwd)"/verbose_test.log_v \
422+
git -C verbose_test status --deserialize=../verbose_test.dat_v -v >output.des.long_v &&
423+
424+
# Verify that vebose mode produces the same result because verbose was rejected.
425+
test_i18ncmp output.ser.long_v output.des.long_v &&
426+
grep -q "deserialize/reject:args/verbose" verbose_test.log_v
427+
'
428+
390429
test_done

0 commit comments

Comments
 (0)