merge: allocate merge flags for internal use Allocate flags in git_merge_flag_t and git_merge_file_flag_t for internal usage to prevent accidental double allocation.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
diff --git a/include/git2/merge.h b/include/git2/merge.h
index edd090c..a308339 100644
--- a/include/git2/merge.h
+++ b/include/git2/merge.h
@@ -91,7 +91,10 @@ typedef enum {
* instead simply use the first base. This flag provides a similar
* merge base to `git-merge-resolve`.
*/
- GIT_MERGE_NO_RECURSIVE = (1 << 3)
+ GIT_MERGE_NO_RECURSIVE = (1 << 3),
+
+ /* This flag is reserved for internal library use */
+ GIT_MERGE__INTERNAL_FLAG = (1 << 30)
} git_merge_flag_t;
/**
@@ -162,7 +165,10 @@ typedef enum {
GIT_MERGE_FILE_DIFF_MINIMAL = (1 << 7),
/** Create zdiff3 ("zealous diff3")-style files */
- GIT_MERGE_FILE_STYLE_ZDIFF3 = (1 << 8)
+ GIT_MERGE_FILE_STYLE_ZDIFF3 = (1 << 8),
+
+ /* This flag is reserved for internal library use */
+ GIT_MERGE_FILE__INTERNAL_FLAG = (1 << 30)
} git_merge_file_flag_t;
#define GIT_MERGE_CONFLICT_MARKER_SIZE 7
diff --git a/src/merge.h b/src/merge.h
index 1b541bf..e033e87 100644
--- a/src/merge.h
+++ b/src/merge.h
@@ -27,15 +27,12 @@
/** Internal merge flags. */
-enum {
- /** The merge is for a virtual base in a recursive merge. */
- GIT_MERGE__VIRTUAL_BASE = (1 << 31)
-};
-
-enum {
- /** Accept the conflict file, staging it as the merge result. */
- GIT_MERGE_FILE__CONFLICTED = (1 << 30)
-};
+
+/** The merge is for a virtual base in a recursive merge. */
+#define GIT_MERGE__VIRTUAL_BASE (GIT_MERGE__INTERNAL_FLAG)
+
+/** Accept the conflict file, staging it as the merge result. */
+#define GIT_MERGE_FILE__CONFLICTED (GIT_MERGE_FILE__INTERNAL_FLAG)
/** Types of changes when files are merged from branch to branch. */