mirror of
https://github.com/git/git.git
synced 2024-10-30 22:07:53 +01:00
fsck: call fsck_finish() after fscking objects
Now that the internal fsck code is capable of checking .gitmodules files, we just need to teach its callers to use the "finish" function to check any queued objects. With this, we can now catch the malicious case in t7415 with git-fsck. Signed-off-by: Jeff King <peff@peff.net>
This commit is contained in:
parent
ed8b10f631
commit
1995b5e03e
2 changed files with 7 additions and 0 deletions
|
@ -748,6 +748,9 @@ int cmd_fsck(int argc, const char **argv, const char *prefix)
|
||||||
}
|
}
|
||||||
stop_progress(&progress);
|
stop_progress(&progress);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (fsck_finish(&fsck_obj_options))
|
||||||
|
errors_found |= ERROR_OBJECT;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < argc; i++) {
|
for (i = 0; i < argc; i++) {
|
||||||
|
|
|
@ -73,4 +73,8 @@ test_expect_success 'clone evil superproject' '
|
||||||
! grep "RUNNING POST CHECKOUT" output
|
! grep "RUNNING POST CHECKOUT" output
|
||||||
'
|
'
|
||||||
|
|
||||||
|
test_expect_success 'fsck detects evil superproject' '
|
||||||
|
test_must_fail git fsck
|
||||||
|
'
|
||||||
|
|
||||||
test_done
|
test_done
|
||||||
|
|
Loading…
Reference in a new issue