Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-03-31 04:29:48 +0400
committerJunio C Hamano <gitster@pobox.com>2008-03-31 09:22:09 +0400
commit948dd346fd6748f8c2c0ae488759cbbd05a09320 (patch)
tree63ea6a54d1824350aa14b1353b65671ea186c21a /t/t2201-add-update-typechange.sh
parent6301f303d436f226b705380ab97c7c0122374241 (diff)
diff-index: careful when inspecting work tree items
Earlier, if you changed a staged path into a directory in the work tree, we happily ran lstat(2) on it and found that it exists, and declared that the user changed it to a gitlink. This is wrong for two reasons: (1) It may be a directory, but it may not be a submodule, and in the latter case, the change we need to report is "the blob at the path has disappeared". We need to check with resolve_gitlink_ref() to be consistent with what "git add" and "git update-index --add" does. (2) lstat(2) may have succeeded only because a leading component of the path was turned into a symbolic link that points at something that exists in the work tree. In such a case, the path itself does not exist anymore, as far as the index is concerned. This fixes these breakages in diff-index that the previous patch has exposed. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t2201-add-update-typechange.sh')
-rwxr-xr-xt/t2201-add-update-typechange.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/t/t2201-add-update-typechange.sh b/t/t2201-add-update-typechange.sh
index 75c440c74b..469a8e0739 100755
--- a/t/t2201-add-update-typechange.sh
+++ b/t/t2201-add-update-typechange.sh
@@ -109,7 +109,7 @@ test_expect_failure diff-files '
diff -u expect-files actual
'
-test_expect_failure diff-index '
+test_expect_success diff-index '
git diff-index --raw HEAD -- >actual &&
diff -u expect-index actual
'