diff options
| author | Siddharth Shrimali <r.siddharth.shrimali@gmail.com> | 2026-08-14 01:38:30 +0530 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2026-08-13 13:34:50 -0700 |
| commit | c6fed8b7a674840c5fc698c9aa1ddd9b8cc9b97d (patch) | |
| tree | 52f95dba639f5ddfcfef86df3db0796227814e54 /gitweb | |
| parent | 0c4142a25b94ef9e706c8b8b7d2c8300dde9a726 (diff) | |
builtin/repack: add guards for --drop-filtered
--drop-filtered removes local promisor blobs. That is only safe when the
repository is not mid-operation and when the blobs are not actively in
use, so add two guards, both skipped for bare repositories which have
neither a worktree nor an index.
First, refuse to run while a merge, rebase, am, cherry-pick, revert, or
bisect is in progress. During these operations the working tree and
index are in an intermediate state, and rewriting packs and deleting
objects underneath a half-finished operation is unsafe.
Second, refuse to drop a blob that the current index references. Such a
blob is needed by the working tree, so dropping it would only cause the
next command that touches the worktree to lazy-fetch it straight back,
reclaiming nothing. The offending path is reported so the user can see
why the drop was refused.
Mentored-by: Christian Couder <christian.couder@gmail.com>
Mentored-by: Siddharth Asthana <siddharthasthana31@gmail.com>
Signed-off-by: Siddharth Shrimali <r.siddharth.shrimali@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'gitweb')
0 files changed, 0 insertions, 0 deletions
