I am trying to apply a series of patches from 1 git repository to another git repository using git am -3 "path to a patch". I apply them in order, from patch 1-4, it works fine.
But when I come to 5th patch,I get the error saying "fatal: sha1 information is lacking or useless". I go the to git repository where I apply the patch, I do see the file 'dev/afile'. So I wonder why git is complaining about "sha1 information is lacking or useless (dev/afile.c)" and how can I fix my problem?
$ git am -3 ~/Tmp/mypatches/0005-fifth.patch
Applying: rpmsg: Allow devices to use custom buffer allocator
fatal: sha1 information is lacking or useless (dev/afile.c).
Repository lacks necessary blobs to fall back on 3-way merge.
Cannot fall back to three-way merge.
Patch failed at 0001 first patch
When you have resolved this problem run "git am --resolved".
If you would prefer to skip this patch, instead run "git am --skip".
To restore the original branch and stop patching run "git am --abort".
And why it said "Patch failed at 0001 first patch", when I do "git am -3 ~/Tmp/mypatches/0005-fifth.patch", it completes with no error.
Thank you.
Just did the following and was able to solve this issue:
patch -p1 < example.patch
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With