summaryrefslogtreecommitdiff
path: root/commit.h
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2018-10-24 15:56:12 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-10-25 03:59:27 (GMT)
commit2588f6ed8bd4e31c1ea1ae35f9f668452b46f1ef (patch)
tree69f2ab637108682342619f436bcfdb530fb4782b /commit.h
parent328a43518244b970e1765eca78060bfeb265a584 (diff)
downloadgit-2588f6ed8bd4e31c1ea1ae35f9f668452b46f1ef.zip
git-2588f6ed8bd4e31c1ea1ae35f9f668452b46f1ef.tar.gz
git-2588f6ed8bd4e31c1ea1ae35f9f668452b46f1ef.tar.bz2
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 'commit.h')
-rw-r--r--commit.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/commit.h b/commit.h
index da0db36..861a159 100644
--- a/commit.h
+++ b/commit.h
@@ -255,7 +255,9 @@ extern void assign_shallow_commits_to_refs(struct shallow_info *info,
uint32_t **used,
int *ref_status);
extern int delayed_reachability_test(struct shallow_info *si, int c);
-extern void prune_shallow(int show_only);
+#define PRUNE_SHOW_ONLY 1
+#define PRUNE_QUICK 2
+extern void prune_shallow(unsigned options);
extern struct trace_key trace_shallow;
int is_descendant_of(struct commit *, struct commit_list *);