summaryrefslogtreecommitdiff
path: root/builtin/commit.c
diff options
context:
space:
mode:
authorThomas Rast <trast@student.ethz.ch>2011-12-06 17:43:37 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-12-06 22:57:36 (GMT)
commit996277c520641d650dc15ad751cc4ad33318e298 (patch)
tree53ba60089bcd1c336438f7ac7d5f2d124029fece /builtin/commit.c
parent4eb0346fb8f8a59a1fb7a6bd01154655a7020087 (diff)
downloadgit-996277c520641d650dc15ad751cc4ad33318e298.zip
git-996277c520641d650dc15ad751cc4ad33318e298.tar.gz
git-996277c520641d650dc15ad751cc4ad33318e298.tar.bz2
Refactor cache_tree_update idiom from commit
We'll need to safely create or update the cache-tree data of the_index from other places. While at it, give it an argument that lets us silence the messages produced by unmerged entries (which prevent it from working). Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/commit.c')
-rw-r--r--builtin/commit.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/builtin/commit.c b/builtin/commit.c
index 8f2bebe..4f782a3 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -862,10 +862,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
*/
discard_cache();
read_cache_from(index_file);
- if (!active_cache_tree)
- active_cache_tree = cache_tree();
- if (cache_tree_update(active_cache_tree,
- active_cache, active_nr, 0, 0) < 0) {
+ if (update_main_cache_tree(0)) {
error(_("Error building trees"));
return 0;
}