summaryrefslogtreecommitdiff
path: root/src/tree.c
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 /src/tree.c
parent29c16698b2014e949af3fce2fb4b9d49a2f2d717 (diff)
parentf92bcaea499611bf0e6a71e845a2d74c790ea659 (diff)
downloadlibgit2-d18713fb4ad1ba3d18a75272e1c1c3eb45715aba.tar.gz
Merge pull request #1056 from nulltoken/duplicate-tree-entries
Duplicate tree entries
Diffstat (limited to 'src/tree.c')
-rw-r--r--src/tree.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/tree.c b/src/tree.c
index 46b4a6dd1..7b47af347 100644
--- a/src/tree.c
+++ b/src/tree.c
@@ -497,6 +497,12 @@ int git_tree__write_index(git_oid *oid, git_index *index, git_repository *repo)
assert(oid && index && repo);
+ if (git_index_has_conflicts(index)) {
+ giterr_set(GITERR_INDEX,
+ "Cannot create a tree from a not fully merged index.");
+ return GIT_EUNMERGED;
+ }
+
if (index->tree != NULL && index->tree->entries >= 0) {
git_oid_cpy(oid, &index->tree->oid);
return 0;