Re: Behavior of git rm

2013-04-04 Thread Jeff King
On Wed, Apr 03, 2013 at 10:35:52AM -0700, Junio C Hamano wrote: Jeff King p...@peff.net writes: Of the two situations, I think the first one is less likely to be destructive (noticing that a file is already gone via ENOTDIR), as we are only proceeding with the index deletion, and we end

Re: Behavior of git rm

2013-04-03 Thread Jeff King
On Wed, Apr 03, 2013 at 07:50:24AM -0700, jpinheiro wrote: While experimenting with git we found an unexpected behavior with git rm. Here is a trace of the unexpected behavior: $ git init $ mkdir D $ echo Hi D/F $ git add D/F $ rm -r D $ echo Hey D $ git rm D/F warning: 'D/F': Not a

Re: Behavior of git rm

2013-04-03 Thread Junio C Hamano
Jeff King p...@peff.net writes: Of the two situations, I think the first one is less likely to be destructive (noticing that a file is already gone via ENOTDIR), as we are only proceeding with the index deletion, and we end up not touching the filesystem at all. Nice to see sound reasoning.

Re: Behavior of git rm

2013-04-03 Thread Jeff King
On Wed, Apr 03, 2013 at 10:35:52AM -0700, Junio C Hamano wrote: diff --git a/builtin/rm.c b/builtin/rm.c index dabfcf6..7b91d52 100644 --- a/builtin/rm.c +++ b/builtin/rm.c @@ -110,7 +110,7 @@ static int check_local_mod(unsigned char *head, int index_only) ce =