Implements .promisor packfile detection #5996
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A .pack file can be marked as being "keep" or "promisor" if a file exists next to it with the same name but a different extension. Before this change, .keep files were being checked but .promisor were not. Now both are being checked (but neither one is used for anything).
Tidies up the code in
git_packfile_alloc
slightly - the logic of "only search for related files if an extension is present" is actually the same as before, but before it wasn't as clear.Reuses the
git_disable_pack_keep_file_checks
config variable.The plan is to use this to report certain missing objects as being "promised" in a partial clone, so that clients can treat those objects differently to objects that simply don't exist or are corrupted for some reason - perhaps fetching them if needed. See #5564
Uses the same test-repo as #5993 (also waiting for review).
Possible objections:
git_disable_pack_keep_file_checks
, or maybe it should be renamed.More-or-less a subset of #5776, except that this PR also has tests - that PR had a larger scope than this one and has been closed for reasons not relevant to this one.