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:
-rw-r--r--pack-bitmap.c16
-rw-r--r--pack-bitmap.h1
2 files changed, 17 insertions, 0 deletions
diff --git a/pack-bitmap.c b/pack-bitmap.c
index 612f62da97..d5296750eb 100644
--- a/pack-bitmap.c
+++ b/pack-bitmap.c
@@ -1658,3 +1658,19 @@ const struct string_list *bitmap_preferred_tips(struct repository *r)
{
return repo_config_get_value_multi(r, "pack.preferbitmaptips");
}
+
+int bitmap_is_preferred_refname(struct repository *r, const char *refname)
+{
+ const struct string_list *preferred_tips = bitmap_preferred_tips(r);
+ struct string_list_item *item;
+
+ if (!preferred_tips)
+ return 0;
+
+ for_each_string_list_item(item, preferred_tips) {
+ if (starts_with(refname, item->string))
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/pack-bitmap.h b/pack-bitmap.h
index 020cd8d868..52ea10de51 100644
--- a/pack-bitmap.h
+++ b/pack-bitmap.h
@@ -94,5 +94,6 @@ void bitmap_writer_finish(struct pack_idx_entry **index,
uint16_t options);
const struct string_list *bitmap_preferred_tips(struct repository *r);
+int bitmap_is_preferred_refname(struct repository *r, const char *refname);
#endif