summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 790fa0e)
raw | patch | inline | side by side (parent: 790fa0e)
author | Junio C Hamano <junkio@cox.net> | |
Sun, 17 Dec 2006 09:09:41 +0000 (01:09 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sun, 17 Dec 2006 09:14:43 +0000 (01:14 -0800) |
When replacing an existing file A with a directory A that has a
file A/B in it in the index, 'git add' did not succeed because
it forgot to pass the allow-replace flag to add_cache_entry().
It might be safer to leave this as an error and require the user
to explicitly remove the existing A first before adding A/B
since it is an unusual case, but doing that automatically is
much easier to use.
Signed-off-by: Junio C Hamano <junkio@cox.net>
file A/B in it in the index, 'git add' did not succeed because
it forgot to pass the allow-replace flag to add_cache_entry().
It might be safer to leave this as an error and require the user
to explicitly remove the existing A first before adding A/B
since it is an unusual case, but doing that automatically is
much easier to use.
Signed-off-by: Junio C Hamano <junkio@cox.net>
read-cache.c | patch | blob | history |
diff --git a/read-cache.c b/read-cache.c
index a602010a69352f774e9446d0106752c0127d917f..983e68b892a9922e8d46c83a5a39b36d535d95dd 100644 (file)
--- a/read-cache.c
+++ b/read-cache.c
if (index_path(ce->sha1, path, &st, 1))
die("unable to index file %s", path);
- if (add_cache_entry(ce, ADD_CACHE_OK_TO_ADD))
+ if (add_cache_entry(ce, ADD_CACHE_OK_TO_ADD|ADD_CACHE_OK_TO_REPLACE))
die("unable to add %s to index",path);
if (verbose)
printf("add '%s'\n", path);