Re: git-apply fails on creating a new file, with both -p and --directory specified
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 8, 2009, 03:20 UTC
- Message-ID
- <7v3a3mqhhd.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <7vk4wyqigf.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
> James Vega <vega.james@gmail.com> 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)