I created a diff file by a command:
git --no-pager diff --no-index --stat pathA pathB >\diff.log
Nextly, I executed a command:
git apply --index --ignore-space-change --ignore-whitespace \diff.log
During the execution I encountered an error:
error: git diff header lacks filename information when removing 1 leading pathname component (line 2138)
Line 2138 leads to:
2136 diff --git a/C:\Temp\right_tmp5D66/file.cpp b/file.cpp
2137 new file mode 100644
2138 index 0000000000000000000000000000000000000000..e69de...
2139 diff --git ......
I have tried a command "git apply --reject ..." but it also didn't work. I also added config which ignores chmod changes (git config core.fileMode false) and nothing was changed.