summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 82ca505)
raw | patch | inline | side by side (parent: 82ca505)
author | Junio C Hamano <junkio@cox.net> | |
Mon, 2 Oct 2006 05:22:07 +0000 (22:22 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Mon, 2 Oct 2006 06:32:39 +0000 (23:32 -0700) |
The command updated the cache without invalidating the cache
tree entries while removing an existing entry.
Signed-off-by: Junio C Hamano <junkio@cox.net>
tree entries while removing an existing entry.
Signed-off-by: Junio C Hamano <junkio@cox.net>
builtin-mv.c | patch | blob | history | |
t/t7001-mv.sh | patch | blob | history |
diff --git a/builtin-mv.c b/builtin-mv.c
index ff882bec474c59c9cb4bb49d723cf81febb204ad..6b0ab8aa9fb63e6879d2e4173523d8fbb9d06929 100644 (file)
--- a/builtin-mv.c
+++ b/builtin-mv.c
for (i = 0; i < deleted.nr; i++) {
const char *path = deleted.items[i].path;
remove_file_from_cache(path);
+ cache_tree_invalidate_path(active_cache_tree, path);
}
if (active_cache_changed) {
diff --git a/t/t7001-mv.sh b/t/t7001-mv.sh
index b7fcdb390c588545f2419ab3c825b924fbf96dd2..23a1eff3bba4505d449bd5fdffb3daf7f9b23ddf 100755 (executable)
--- a/t/t7001-mv.sh
+++ b/t/t7001-mv.sh
'move into "."' \
'git-mv path1/path2/ .'
+test_expect_success "Michael Cassar's test case" '
+ rm -fr .git papers partA &&
+ git init-db &&
+ mkdir -p papers/unsorted papers/all-papers partA &&
+ echo a > papers/unsorted/Thesis.pdf &&
+ echo b > partA/outline.txt &&
+ echo c > papers/unsorted/_another &&
+ git add papers partA &&
+ T1=`git write-tree` &&
+
+ git mv papers/unsorted/Thesis.pdf papers/all-papers/moo-blah.pdf &&
+
+ T=`git write-tree` &&
+ git ls-tree -r $T | grep partA/outline.txt || {
+ git ls-tree -r $T
+ (exit 1)
+ }
+'
+
test_done