author | Junio C Hamano <junkio@cox.net> | |
Sun, 8 May 2005 07:05:18 +0000 (00:05 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sun, 8 May 2005 07:05:18 +0000 (00:05 -0700) | ||
commit | 4c5abf428203524aac7ec094da692e5b89782127 | |
tree | 5bd89fe05bd53351e5d32641bc03a221fbafaf3c | tree | snapshot |
parent | 192268c197c0f143989662f648b1d900014e7d89 | commit | diff |
Allow removal of "path" when "path/file" exists.
When we used to have "path" as a file or a symlink, but now we
have "path/file" (or in general, have "path" as a directory), we
would want to remove "path" before adding "path/file". The
logic in add_file_to_cache() only runs lstat() and does not
detect this case and fails to allow removing it in this case.
In the opposite case of having "path/file" in the index and
having "path" on the filesystem as a file or a symlink we do
allow removal of "path/file", so to be symmetric we should allow
it as well, without forcing the user to say --force-remove.
Signed-off-by: Junio C Hamano <junkio@cox.net>
When we used to have "path" as a file or a symlink, but now we
have "path/file" (or in general, have "path" as a directory), we
would want to remove "path" before adding "path/file". The
logic in add_file_to_cache() only runs lstat() and does not
detect this case and fails to allow removing it in this case.
In the opposite case of having "path/file" in the index and
having "path" on the filesystem as a file or a symlink we do
allow removal of "path/file", so to be symmetric we should allow
it as well, without forcing the user to say --force-remove.
Signed-off-by: Junio C Hamano <junkio@cox.net>
update-cache.c | diff | blob | history |