diff options
author | nulltoken <emeric.fermas@gmail.com> | 2012-11-08 17:39:23 +0100 |
---|---|---|
committer | nulltoken <emeric.fermas@gmail.com> | 2012-11-09 16:45:47 +0100 |
commit | f92bcaea499611bf0e6a71e845a2d74c790ea659 (patch) | |
tree | aa210a84f473a864470de8ab6e0b54635b245714 /include/git2/index.h | |
parent | 7cc1bf0fcb6de212dc50e02ff187880af9103bf4 (diff) | |
download | libgit2-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.h | 10 |
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); |