Review/Apply single patch does not work anymore if patch does not apply cleanly
Hi
What steps will reproduce the problem?
- create 2 working copies for 2 branches of a same collection (B1 and B2). B1 and B2 should be similar enough in order that a patch from B1 on B2 is relevant.
- in log view for B1, select whatever unique file in whatever commit, having the "view patch" function enabled
- select the content of the patch view and save it as "1.patch" under the main directory of the working copy of B2
- right click on 1.patch and select "Review/Apply single patch"
What is the expected output? What do you see instead?
The TortoiseGitMerge should open and show the file to be patched in the summary window.
Instead it consequently shows a message box:
Could not parse revision.
libgit2 returned: revspec 'xxxxxxx' not found
where 'xxxxxxx' is an hexa value.
What version of TortoiseGit and Git are you using? On what operating system?
TG 2.7.0.0
Git 2.18.0.windows.1
Please provide any additional information below.
By comparing the value in the box with the content of the patch I can see that it is the last 7 chars of the first number given on the 'index' line (the 2nd line, just under the first one 'diff....'). But this number contains 9 chars in my file. It is as if TortoiseGit expected indexes made of only 7 chars.
Sure enough, if I get older patches, they all have 'index 1234567..1234567 100644', but never 'index 123456789..123456789 100644'. TortoiseGit handle them without any problems.
If I now take the patch I just generated, and remove the last 2 digits of each index value, it works too.
Maybe there was a format change in Git about indexes that TortoiseGit was not aware of.
Regards
Leto