]> git.ipfire.org Git - thirdparty/git.git/blobdiff - commit-reach.h
Merge branch 'sb/more-repo-in-api'
[thirdparty/git.git] / commit-reach.h
index a0d4a29d259ae8e4bc08463d848d28f5fa06728e..99a43e8b64fc803d7b7f4d09d11c2ec31fdb0a76 100644 (file)
@@ -1,12 +1,13 @@
-#ifndef __COMMIT_REACH_H__
-#define __COMMIT_REACH_H__
+#ifndef COMMIT_REACH_H
+#define COMMIT_REACH_H
 
+#include "commit.h"
 #include "commit-slab.h"
 
-struct commit;
 struct commit_list;
-struct contains_cache;
 struct ref_filter;
+struct object_id;
+struct object_array;
 
 struct commit_list *repo_get_merge_bases(struct repository *r,
                                         struct commit *rev1,
@@ -88,4 +89,17 @@ int can_all_from_reach_with_flag(struct object_array *from,
 int can_all_from_reach(struct commit_list *from, struct commit_list *to,
                       int commit_date_cutoff);
 
+
+/*
+ * Return a list of commits containing the commits in the 'to' array
+ * that are reachable from at least one commit in the 'from' array.
+ * Also add the given 'flag' to each of the commits in the returned list.
+ *
+ * This method uses the PARENT1 and PARENT2 flags during its operation,
+ * so be sure these flags are not set before calling the method.
+ */
+struct commit_list *get_reachable_subset(struct commit **from, int nr_from,
+                                        struct commit **to, int nr_to,
+                                        unsigned int reachable_flag);
+
 #endif