]> git.ipfire.org Git - thirdparty/git.git/commit
shallow: offer to prune only non-existing entries
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Wed, 24 Oct 2018 15:56:12 +0000 (08:56 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 25 Oct 2018 03:59:27 +0000 (12:59 +0900)
commit2588f6ed8bd4e31c1ea1ae35f9f668452b46f1ef
tree69f2ab637108682342619f436bcfdb530fb4782b
parent328a43518244b970e1765eca78060bfeb265a584
shallow: offer to prune only non-existing entries

The `prune_shallow()` function wants a full reachability check to be
completed before it goes to work, to ensure that all unreachable entries
are removed from the shallow file.

However, in the upcoming patch we do not even want to go that far. We
really only need to remove entries corresponding to pruned commits, i.e.
to commits that no longer exist.

Let's support that use case.

Rather than extending the signature of `prune_shallow()` to accept
another Boolean, let's turn it into a bit field and declare constants,
for readability.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/prune.c
commit.h
shallow.c