summaryrefslogtreecommitdiff
path: root/include/git2/index.h
diff options
context:
space:
mode:
authorVicent Martí <vicent@github.com>2012-11-10 20:24:53 -0800
committerVicent Martí <vicent@github.com>2012-11-10 20:24:53 -0800
commitd18713fb4ad1ba3d18a75272e1c1c3eb45715aba (patch)
treed7ccd21ac63656792ddc7d012076bf054fa18cf9 /include/git2/index.h
parent29c16698b2014e949af3fce2fb4b9d49a2f2d717 (diff)
parentf92bcaea499611bf0e6a71e845a2d74c790ea659 (diff)
downloadlibgit2-d18713fb4ad1ba3d18a75272e1c1c3eb45715aba.tar.gz
Merge pull request #1056 from nulltoken/duplicate-tree-entries
Duplicate tree entries
Diffstat (limited to 'include/git2/index.h')
-rw-r--r--include/git2/index.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/include/git2/index.h b/include/git2/index.h
index bca9791c5..8e1a7e521 100644
--- a/include/git2/index.h
+++ b/include/git2/index.h
@@ -215,9 +215,12 @@ GIT_EXTERN(int) git_index_read_tree(git_index *index, git_tree *tree);
* The index instance cannot be bare, and needs to be associated
* to an existing repository.
*
+ * The index must not contain any file in conflict.
+ *
* @param oid Pointer where to store the OID of the written tree
* @param index Index to write
- * @return 0 or an error code
+ * @return 0 on success, GIT_EUNMERGED when the index is not clean
+ * or an error code
*/
GIT_EXTERN(int) git_index_write_tree(git_oid *oid, git_index *index);
@@ -228,10 +231,13 @@ GIT_EXTERN(int) git_index_write_tree(git_oid *oid, git_index *index);
* letting the user choose the repository where the tree will
* be written.
*
+ * The index must not contain any file in conflict.
+ *
* @param oid Pointer where to store OID of the the written tree
* @param index Index to write
* @param repo Repository where to write the tree
- * @return 0 or an error code
+ * @return 0 on success, GIT_EUNMERGED when the index is not clean
+ * or an error code
*/
GIT_EXTERN(int) git_index_write_tree_to(git_oid *oid, git_index *index, git_repository *repo);
@@ -431,6 +437,13 @@ GIT_EXTERN(int) git_index_conflict_remove(git_index *index, const char *path);
*/
GIT_EXTERN(void) git_index_conflict_cleanup(git_index *index);
+/**
+ * Determine if the index contains entries representing file conflicts.
+ *
+ * @return 1 if at least one conflict is found, 0 otherwise.
+ */
+GIT_EXTERN(int) git_index_has_conflicts(git_index *index);
+
/**@}*/
/** @name Resolve Undo (REUC) index entry manipulation.