Subject: Re: New directory lost by git am

From: Chris Packham <[email-masked]>
Date: Wed, 05 Mar 2014 16:08:57 +1300

Hi,

On 05/03/14 15:49, Phillip Susi wrote:
> I applied a patch with git am that adds a new source file to a new
> directory, and later noticed that file was missing from the commit.
> It seems that git am fails to add the new file/directory to the index.
> 

Could you provide a few more details such as your git version (git
--version) and an example of the failure. I've tried to reproduce the
problem based on the description provided but everything seems to work
as expected for me.

  git --version
    git version 1.9.0
  mkdir test && cd test && git init
  echo "hello world" >a.txt
  git add a.txt
  git commit -m"Initial commit"
  git checkout -b temp
  mkdir b
  echo "lorem ipsum" >b/b.txt
  git add b/b.txt
  git commit -m"Add b/b.txt"
  ls -R
    .:
    a.txt  b

    ./b:
    b.txt
  git checkout master
  git format-patch temp -1 --stdout | git am
  ls -R
    .:
    a.txt  b

    ./b:
    b.txt