Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(gc): make --prune=now compatible with --expire-to
The original `git gc --prune=now` attempted to delete all unreachable objects. However, after the introduction of `--cruft` and `--expire-to=<dir>` in git gc, `--prune=now` can now compress unreachable objects into a cruft pack and store them in the specified <dir> instead of deleting them directly. This is beneficial for recovery in case of data corruption during repository GC. Therefore, update the handling logic of `--prune=now` in gc so that `-a` parameter is only passed to the repack command when neither `--cruft` nor `--expire-to` are used. Signed-off-by: ZheNing Hu <[email protected]>
- Loading branch information