summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7b520e6)
raw | patch | inline | side by side (parent: 7b520e6)
author | Junio C Hamano <junkio@cox.net> | |
Mon, 17 Jul 2006 06:25:12 +0000 (23:25 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Mon, 17 Jul 2006 06:25:12 +0000 (23:25 -0700) |
When path foo/bar existed in the working tree, checkout -f to switch to
a branch that has a file foo silently did a wrong thing. It failed to
remove the directory foo, did not check out the file foo, and the worst
of all it did not report any errors.
Signed-off-by: Junio C Hamano <junkio@cox.net>
a branch that has a file foo silently did a wrong thing. It failed to
remove the directory foo, did not check out the file foo, and the worst
of all it did not report any errors.
Signed-off-by: Junio C Hamano <junkio@cox.net>
builtin-read-tree.c | patch | blob | history |
diff --git a/builtin-read-tree.c b/builtin-read-tree.c
index 6df5d7c5cbe2cd524cda9e0636c3ed5a8259cf33..122b6f130b37b27055efd7dffa25f41ef03698e8 100644 (file)
--- a/builtin-read-tree.c
+++ b/builtin-read-tree.c
}
merge->ce_flags &= ~htons(CE_STAGEMASK);
- add_cache_entry(merge, ADD_CACHE_OK_TO_ADD);
+ add_cache_entry(merge, ADD_CACHE_OK_TO_ADD|ADD_CACHE_OK_TO_REPLACE);
return 1;
}
else
verify_absent(ce->name, "removed");
ce->ce_mode = 0;
- add_cache_entry(ce, ADD_CACHE_OK_TO_ADD);
+ add_cache_entry(ce, ADD_CACHE_OK_TO_ADD|ADD_CACHE_OK_TO_REPLACE);
invalidate_ce_path(ce);
return 1;
}