summaryrefslogtreecommitdiff
path: root/builtin/commit.c
diff options
context:
space:
mode:
authorDenton Liu <liu.denton@gmail.com>2019-12-04 14:03:09 -0800
committerJunio C Hamano <gitster@pobox.com>2019-12-04 14:25:05 -0800
commitae475afc0f8685607e2de838db7fb4bee7934d4d (patch)
treeef1cab27d567a94ea1d7793d99966e8f152af52d /builtin/commit.c
parent17a4ae92eaa2f9614d739c11c3b60932a0f272b9 (diff)
t7700: consolidate code into test_no_missing_in_packs()
The code to test that objects were not missing from the packfile was duplicated many times. Extract the duplicated code into test_no_missing_in_packs() and use that instead. Refactor the resulting extraction so that if any git commands fail, their return codes are not silently lost. Instead of verifying each file of `alt_objects/pack/*.idx` individually in a for-loop, batch them together into one verification step. The original testing construct was O(n^2): it used a grep in a loop to test whether any objects were missing in the packfile. Rewrite this to extract the hash using sed or cut, sort the files, then use `comm -23` so that finding missing lines from the original file is done more efficiently. While we're at it, add a space to `commit_and_pack ()` for style. Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/commit.c')
0 files changed, 0 insertions, 0 deletions