summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ea02eef)
raw | patch | inline | side by side (parent: ea02eef)
author | Clemens Buchacher <drizzd@aon.at> | |
Thu, 1 Jan 2009 20:54:31 +0000 (21:54 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 5 Jan 2009 20:45:38 +0000 (12:45 -0800) |
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>
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>
t/t1001-read-tree-m-2way.sh | patch | blob | history | |
unpack-trees.c | patch | blob | history |
index 4b44e131b27df0cc6a73590b045c2eb87b104f59..7f6ab31c36a2be8705b7eb5f0118f89c5ab58d19 100755 (executable)
check_cache_at DF/DF dirty &&
:'
+test_expect_success \
+ 'a/b (untracked) vs a case setup.' \
+ 'rm -f .git/index &&
+ : >a &&
+ git update-index --add a &&
+ treeM=`git write-tree` &&
+ echo treeM $treeM &&
+ git ls-tree $treeM &&
+ git ls-files --stage >treeM.out &&
+
+ rm -f a &&
+ git update-index --remove a &&
+ mkdir a &&
+ : >a/b &&
+ treeH=`git write-tree` &&
+ echo treeH $treeH &&
+ git ls-tree $treeH'
+
+test_expect_success \
+ 'a/b (untracked) vs a, plus c/d case test.' \
+ '! git read-tree -u -m "$treeH" "$treeM" &&
+ git ls-files --stage &&
+ test -f a/b'
+
test_done
diff --git a/unpack-trees.c b/unpack-trees.c
index cba0aca062f201c5cd5f8799f2190d4a6f06e7c7..3f42c2997f7bc4c97991b587594a7c584dcbe0f8 100644 (file)
--- a/unpack-trees.c
+++ b/unpack-trees.c
return 0;
if (!lstat(ce->name, &st)) {
- int cnt;
+ int ret;
int dtype = ce_to_dtype(ce);
struct cache_entry *result;
* 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,
* We need to increment it by the number of
* deleted entries here.
*/
- o->pos += cnt;
+ o->pos += ret;
return 0;
}