summaryrefslogtreecommitdiff
path: root/include/git2
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2015-10-22 14:39:20 -0400
committerEdward Thomson <ethomson@edwardthomson.com>2015-10-22 14:55:17 -0400
commit8683d31f080eb12fe769ab2363165ec17562c840 (patch)
tree444c214b32d248e4452638478716f883b87bc22a /include/git2
parentdc2cf3eb1a71700a064720618ed5df267cffcbac (diff)
downloadlibgit2-8683d31f080eb12fe769ab2363165ec17562c840.tar.gz
merge: add GIT_MERGE_TREE_FAIL_ON_CONFLICT
Provide a new merge option, GIT_MERGE_TREE_FAIL_ON_CONFLICT, which will stop on the first conflict and fail the merge operation with GIT_EMERGECONFLICT.
Diffstat (limited to 'include/git2')
-rw-r--r--include/git2/errors.h1
-rw-r--r--include/git2/merge.h7
2 files changed, 8 insertions, 0 deletions
diff --git a/include/git2/errors.h b/include/git2/errors.h
index 4698366d8..1b528cf25 100644
--- a/include/git2/errors.h
+++ b/include/git2/errors.h
@@ -49,6 +49,7 @@ typedef enum {
GIT_EINVALID = -21, /**< Invalid operation or input */
GIT_EUNCOMMITTED = -22, /**< Uncommitted changes in index prevented operation */
GIT_EDIRECTORY = -23, /**< The operation is not valid for a directory */
+ GIT_EMERGECONFLICT = -24, /**< A merge conflict exists and cannot continue */
GIT_PASSTHROUGH = -30, /**< Internal only */
GIT_ITEROVER = -31, /**< Signals end of iteration with iterator */
diff --git a/include/git2/merge.h b/include/git2/merge.h
index 5fef452b9..ced9e51ff 100644
--- a/include/git2/merge.h
+++ b/include/git2/merge.h
@@ -72,6 +72,13 @@ typedef enum {
* the ability to merge between a modified and renamed file.
*/
GIT_MERGE_TREE_FIND_RENAMES = (1 << 0),
+
+ /**
+ * If a conflict occurs, exit immediately instead of attempting to
+ * continue resolving conflicts. The merge operation will fail with
+ * GIT_EMERGECONFLICT and no index will be returned.
+ */
+ GIT_MERGE_TREE_FAIL_ON_CONFLICT = (1 << 1),
} git_merge_tree_flag_t;
/**