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:
authorElijah Newren <newren@gmail.com>2022-06-18 03:20:50 +0300
committerJunio C Hamano <gitster@pobox.com>2022-06-23 02:10:06 +0300
commitfae26ce79cad6d290e296e40f2d46eb783e91110 (patch)
treebf5e449ec20ff735b92c615c81d5fc30145529c3 /merge-ort.h
parenta1a7811975e4e3d872379ab03acab9506933de9c (diff)
merge-ort: provide a merge_get_conflicted_files() helper function
After a merge, this function allows the user to extract the same information that would be printed by `ls-files -u`, which means files with their mode, oid, and stage. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'merge-ort.h')
-rw-r--r--merge-ort.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/merge-ort.h b/merge-ort.h
index e5aec45b18..ddcc39d727 100644
--- a/merge-ort.h
+++ b/merge-ort.h
@@ -2,6 +2,7 @@
#define MERGE_ORT_H
#include "merge-recursive.h"
+#include "hash.h"
struct commit;
struct tree;
@@ -88,6 +89,26 @@ void merge_switch_to_result(struct merge_options *opt,
void merge_display_update_messages(struct merge_options *opt,
struct merge_result *result);
+struct stage_info {
+ struct object_id oid;
+ int mode;
+ int stage;
+};
+
+/*
+ * Provide a list of path -> {struct stage_info*} mappings for
+ * all conflicted files. Note that each path could appear up to three
+ * times in the list, corresponding to 3 different stage entries. In short,
+ * this basically provides the info that would be printed by `ls-files -u`.
+ *
+ * result should have been populated by a call to
+ * one of the merge_incore_[non]recursive() functions.
+ *
+ * conflicted_files should be empty before calling this function.
+ */
+void merge_get_conflicted_files(struct merge_result *result,
+ struct string_list *conflicted_files);
+
/* Do needed cleanup when not calling merge_switch_to_result() */
void merge_finalize(struct merge_options *opt,
struct merge_result *result);