From: Junio C Hamano Date: Tue, 08 Dec 2009 03:20:30 GMT Subject: Re: git-apply fails on creating a new file, with both -p and --directory specified Message-ID: <7v3a3mqhhd.fsf@alter.siamese.dyndns.org> In-Reply-To: <7vk4wyqigf.fsf@alter.siamese.dyndns.org> Junio C Hamano writes: > James Vega writes: > >> It looks like this may have introduced a bug when staging a file >> removal. Here's an example git session showing the issue: An update. I tried your reproduction recipe with 1.6.5.2 and it doesn't reproduce, but with 1.6.5.3 it does. $ git init test Initialized empty Git repository in /local_disk/tmp/test/.git/ $ cd test $ echo "foo" > foo $ git add foo $ git commit -m 'Add foo' [master (root-commit) 3643b5d] Add foo 1 files changed, 1 insertions(+), 0 deletions(-) create mode 100644 foo $ mv foo bar $ git add -p diff --git a/foo b/foo index 257cc56..0000000 --- a/foo +++ /dev/null @@ -1 +0,0 @@ -foo Stage this hunk [y,n,q,a,d,/,e,?]? y $ git status # On branch master # Changes to be committed: # (use "git reset HEAD ..." to unstage) # # new file: dev/null # deleted: foo # A quick bisection of the original issue points at 24ab81a (add-interactive: handle deletion of empty files, 2009-10-27)