This reproduces in trunk,, and

I suspect this has to do with a whitespace + no trailing newline
issues. The patch was generated by I mangled it by hand to
get it to be small, but the initial crash happened on a large,
real-world output of "git format-patch".

Error messages:

~/GIT-AM-CRASH$ ../git/git am crashy.patch
Applying: Git crash bug
git: builtin/apply.c:2108: update_pre_post_images: Assertion
` == preimage->nr' failed.
/home/lesha/GIT-AM-CRASH/../git/git-am: line 811: 23819 Aborted
         git apply --index "$dotest/patch"
Patch failed at 0001 Git crash bug
The copy of the patch that failed is found in:
When you have resolved this problem, run "git am --resolved".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

Repro steps:

# download files into this directory
git init .
mkdir -p meep/spork
mv meep/spork
git add meep/spork/
git ci -am 'moo'
git am crashy.patch

Hope this helps!


Attachment: crashy.patch
Description: Binary data

Description: Binary data

Reply via email to