# [PATCH] Clarify commit error message for unmerged files

1 messages from 2008-09-29 to 2008-09-29. Participants: Rafael Garcia-Suarez.
Thread: https://gitlist.dev/t/15706

## Rafael Garcia-Suarez, 2008-09-29 16:04

Subject: [PATCH] Clarify commit error message for unmerged files
Message-ID: <1222704281-10194-1-git-send-email-rgarciasuarez@gmail.com>
URL: https://gitlist.dev/e/1222704281-10194-1-git-send-email-rgarciasuarez%40gmail.com

```
Currently, trying to use git-commit with unmerged files in the index
will show the message "Error building trees", which can be a bit
obscure to the end user. This patch makes the error message clearer, and
consistent with what git-write-tree reports in a similar situation.

Signed-off-by: Rafael Garcia-Suarez <rgarciasuarez@gmail.com>
---
 builtin-commit.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/builtin-commit.c b/builtin-commit.c
index 8165bb3..6b23143 100644
--- a/builtin-commit.c
+++ b/builtin-commit.c
@@ -639,7 +639,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix)
 		active_cache_tree = cache_tree();
 	if (cache_tree_update(active_cache_tree,
 			      active_cache, active_nr, 0, 0) < 0) {
-		error("Error building trees");
+		error("Error building trees; the index is unmerged?");
 		return 0;
 	}
 
-- 
1.6.0.2.307.gc4275.dirty

```
