Commit 5f9fef37548c12ab4d87590e1d6d2cb0929e58e6

Stefan Sperling 2019-01-13T01:42:50

avoid redundant file index additions in install_blob()

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/lib/worktree.c b/lib/worktree.c
index a161221..71f2090 100644
--- a/lib/worktree.c
+++ b/lib/worktree.c
@@ -624,6 +624,8 @@ install_blob(struct got_worktree *worktree, struct got_fileindex *fileindex,
 		}
 	}
 
+	if (entry == NULL)
+		entry = got_fileindex_entry_get(fileindex, path);
 	if (entry)
 		err = got_fileindex_entry_update(entry, ondisk_path,
 		    blob->id.sha1, worktree->base_commit_id->sha1);