desktop icon indicating copy to clipboard operation
desktop copied to clipboard

Merge failed with "Unexpected diff result returned: '2'"

Open ms609 opened this issue 7 years ago • 7 comments

Description

I'm attempting to update my current branch from master, using the "Branch→Update from Master" menu item.

When I click this, it identifies two conflicting files. I've edited these in an external editor to remove the conflicts, and when I return to Github Desktop I see

Resolve conflicts before merging master into mybranch [tick] All conflicts resolved

When I click "Commit merge", I see

Error [!] Unexpected diff result returned: '2'

When I click "Close", I'm back to the "All conflicts resolved" screen; I end up in a loop until I abort the merge.

After aborting the merge, I'm able to commit my changes and push to origin; here's the commit.

Version

  • GitHub Desktop: 1.5.1
  • Operating system: Microsoct Windows [10.0.17134.472]

Additional Information

I don't have Folder Redirection enabled, to my knowledge.

Logs

2019-01-09.desktop.production.log

ms609 avatar Jan 09 '19 12:01 ms609

Hi @ms609, thanks for opening this issue and I'm sorry you encountered this. I tried to reproduce using your repository, but haven't been able to yet. Was "mybranch" the "contour" branch in the Ternary repo? Would you happen to know if the sha before you tried to update from master was 6598bae3dc3d78e214d72c55115899c2274873b1?

I noticed this repo also has git lfs enabled, is that right? That may have influenced this. Perhaps this error was generated due to a binary file in the repo.

(for our future reference: https://github.com/desktop/desktop/blob/760187fde67c49a930ce1299561c2e8494618ffe/app/src/lib/git/apply.ts#L62 is where this error is thrown.

Unexpected diff result returned: '2'

refers to this enum value: https://github.com/desktop/desktop/blob/760187fde67c49a930ce1299561c2e8494618ffe/app/src/models/diff/diff-data.ts#L14-L15

)

outofambit avatar Jan 09 '19 21:01 outofambit

Hi @outofambit , thanks for looking into this. Yes, "mybranch" = "contour". The SHA would have been 6598bae3dc3d78e214d72c55115899c2274873b1 as you said.

LFS is an interesting suggestion, though no files that match the pattern in .gitattributes (i.e. \inst\doc\*) would have been changed at any point, as far as I can see.

No binary files seem to have been involved in the diff or update, though there are two uncommitted binary files that should not have been affected by the merge; they were there before and after the merge. Do let me know if there's any more information I can supply.

ms609 avatar Jan 10 '19 12:01 ms609

I have same issue.

fdtaljaard avatar Jan 11 '19 12:01 fdtaljaard

I wonder whether this is related to the issue that was patched in #6411?

ms609 avatar Jan 18 '19 10:01 ms609

@ms609 that's a really good point! i think that would explain this situation perfectly. i'll see if i can get the same output you had with an untracked binary file in my working directory.

outofambit avatar Jan 18 '19 10:01 outofambit

Same issue here guys.

WojTherapy avatar Jan 30 '19 09:01 WojTherapy

Closing this as stale. I wasn't able to reproduce this issue, but if it is still a problem let us know and we can reopen to investigate further.

steveward avatar Mar 02 '23 21:03 steveward