summaryrefslogtreecommitdiff
path: root/unpack-trees.c
diff options
context:
space:
mode:
authorClemens Buchacher <drizzd@aon.at>2009-01-01 21:54:31 +0100
committerJunio C Hamano <gitster@pobox.com>2009-01-05 12:45:38 -0800
commit6b9315d5a14b4d1389cff347fcfcb86624bbf645 (patch)
tree8e61fe9ff6a9ad3ccc931f7a8c155aa878ce9048 /unpack-trees.c
parentea02eef096d4bfcbb83e76cfab0fcb42dbcad35e (diff)
downloadgit-6b9315d5a14b4d1389cff347fcfcb86624bbf645.tar.gz
unpack-trees: handle failure in verify_absent
Commit 203a2fe1 (Allow callers of unpack_trees() to handle failure) changed the "die on error" behavior to "return failure code". verify_absent did not handle errors returned by verify_clean_subdirectory, however. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'unpack-trees.c')
-rw-r--r--unpack-trees.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/unpack-trees.c b/unpack-trees.c
index cba0aca062..3f42c2997f 100644
--- a/unpack-trees.c
+++ b/unpack-trees.c
@@ -587,7 +587,7 @@ static int verify_absent(struct cache_entry *ce, const char *action,
return 0;
if (!lstat(ce->name, &st)) {
- int cnt;
+ int ret;
int dtype = ce_to_dtype(ce);
struct cache_entry *result;
@@ -615,7 +615,9 @@ static int verify_absent(struct cache_entry *ce, const char *action,
* files that are in "foo/" we would lose
* it.
*/
- cnt = verify_clean_subdirectory(ce, action, o);
+ ret = verify_clean_subdirectory(ce, action, o);
+ if (ret < 0)
+ return ret;
/*
* If this removed entries from the index,
@@ -634,7 +636,7 @@ static int verify_absent(struct cache_entry *ce, const char *action,
* We need to increment it by the number of
* deleted entries here.
*/
- o->pos += cnt;
+ o->pos += ret;
return 0;
}