summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/tree.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tree.c b/src/tree.c
index 693ed1caa..b474d394b 100644
--- a/src/tree.c
+++ b/src/tree.c
@@ -364,7 +364,7 @@ int git_treebuilder_insert(git_tree_entry **entry_out, git_treebuilder *bld, con
git_oid_cpy(&entry->oid, id);
entry->attr = attributes;
- if (pos != GIT_ENOTFOUND) {
+ if (pos == GIT_ENOTFOUND) {
if (git_vector_insert(&bld->entries, entry) < 0)
return GIT_ENOMEM;
}