diff options
| author | Denton Liu <liu.denton@gmail.com> | 2019-12-04 14:03:09 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2019-12-04 14:25:05 -0800 |
| commit | ae475afc0f8685607e2de838db7fb4bee7934d4d (patch) | |
| tree | ef1cab27d567a94ea1d7793d99966e8f152af52d /commit-graph.c | |
| parent | t7700: s/test -f/test_path_is_file/ (diff) | |
| download | git-ae475afc0f8685607e2de838db7fb4bee7934d4d.tar.gz git-ae475afc0f8685607e2de838db7fb4bee7934d4d.zip | |
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 'commit-graph.c')
0 files changed, 0 insertions, 0 deletions
