summaryrefslogtreecommitdiff
path: root/include/git2/index.h
diff options
context:
space:
mode:
authornulltoken <emeric.fermas@gmail.com>2012-11-08 17:39:23 +0100
committernulltoken <emeric.fermas@gmail.com>2012-11-09 16:45:47 +0100
commitf92bcaea499611bf0e6a71e845a2d74c790ea659 (patch)
treeaa210a84f473a864470de8ab6e0b54635b245714 /include/git2/index.h
parent7cc1bf0fcb6de212dc50e02ff187880af9103bf4 (diff)
downloadlibgit2-f92bcaea499611bf0e6a71e845a2d74c790ea659.tar.gz
index: prevent tree creation from a non merged state
Fix libgit2/libgit2sharp#243
Diffstat (limited to 'include/git2/index.h')
-rw-r--r--include/git2/index.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/git2/index.h b/include/git2/index.h
index 1efca72b5..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);