summaryrefslogtreecommitdiffstats
path: root/oidset.h
diff options
context:
space:
mode:
authorChristian Couder <christian.couder@gmail.com>2024-02-14 15:25:11 +0100
committerJunio C Hamano <gitster@pobox.com>2024-02-14 18:39:14 +0100
commiteaf07b7d15e067305d33150eb98bf0351f9f4cbd (patch)
treeeb4ec48ac99f448027dbb95733a785140deb231e /oidset.h
parentrevision: clarify a 'return NULL' in get_reference() (diff)
downloadgit-eaf07b7d15e067305d33150eb98bf0351f9f4cbd.tar.xz
git-eaf07b7d15e067305d33150eb98bf0351f9f4cbd.zip
oidset: refactor oidset_insert_from_set()
In a following commit, we will need to add all the oids from a set into another set. In "list-objects-filter.c", there is already a static function called add_all() to do that. Let's rename this function oidset_insert_from_set() and move it into oidset.{c,h} to make it generally available. While at it, let's remove a useless `!= NULL`. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'oidset.h')
-rw-r--r--oidset.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/oidset.h b/oidset.h
index ba4a5a2cd3..262f4256d6 100644
--- a/oidset.h
+++ b/oidset.h
@@ -48,6 +48,12 @@ int oidset_contains(const struct oidset *set, const struct object_id *oid);
int oidset_insert(struct oidset *set, const struct object_id *oid);
/**
+ * Insert all the oids that are in set 'src' into set 'dest'; a copy
+ * is made of each oid inserted into set 'dest'.
+ */
+void oidset_insert_from_set(struct oidset *dest, struct oidset *src);
+
+/**
* Remove the oid from the set.
*
* Returns 1 if the oid was present in the set, 0 otherwise.