Under certain circumstances, commits that were reachable can be made unreachable, e.g. via `git fetch --prune`. These commits might have been packed already, in which case `git repack -adlf` will just drop them without giving them the usual grace period before an eventual `git prune` (via `git gc`) prunes them. This is a problem when the `shallow` file still lists them, which is the reason why `git prune` edits that file. And with the proposed changes, `git repack -ad` will now do the same. Reported by Alejandro Pauly. Johannes Schindelin (2): repack: point out a bug handling stale shallow info repack -ad: prune the list of shallow commits builtin/repack.c | 4 ++++ t/t5537-fetch-shallow.sh | 27 +++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) base-commit: e3331758f12da22f4103eec7efe1b5304a9be5e9 Published-As: https://github.com/gitgitgadget/git/releases/tags/pr-9%2Fdscho%2Fshallow-and-fetch-prune-v1 Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-9/dscho/shallow-and-fetch-prune-v1 Pull-Request: https://github.com/gitgitgadget/git/pull/9 -- gitgitgadget