Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2018-10-24 18:56:12 +0300
committerJunio C Hamano <gitster@pobox.com>2018-10-25 06:59:27 +0300
commit2588f6ed8bd4e31c1ea1ae35f9f668452b46f1ef (patch)
tree69f2ab637108682342619f436bcfdb530fb4782b /builtin/prune.c
parent328a43518244b970e1765eca78060bfeb265a584 (diff)
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>
Diffstat (limited to 'builtin/prune.c')
-rw-r--r--builtin/prune.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/prune.c b/builtin/prune.c
index 4916a4daa2..b29ce4abbc 100644
--- a/builtin/prune.c
+++ b/builtin/prune.c
@@ -161,7 +161,7 @@ int cmd_prune(int argc, const char **argv, const char *prefix)
free(s);
if (is_repository_shallow(the_repository))
- prune_shallow(show_only);
+ prune_shallow(show_only ? PRUNE_SHOW_ONLY : 0);
return 0;
}