Treat files using the binary merge driver as binary files when resolving conflicts #19271
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #9846
Description
When Desktop encounters a merge, rebase, or stash conflict it attempts to differentiate between files which are plain-text and therefore will contain conflict markers, and files which are binary which will not. Up until now the way we've done so is by running
diff --numstat
and checking which files it deems to be binary (using Git's own heuristics for when a file is binary or not).For some files it's beneficial to treat them as binary even though Git doesn't necessarily see them as such and one way users can do that is by setting the merge attribute in
.gitattributes
tobinary
.With this change we'll respect that specific attribute value and treat matching files as binary. Note that there may be other (custom) merge drivers where only picking one or the other version might be helpful but we can't know that ahead of time so we'll start out simple by just respecting the binary merge driver.
Screenshots
Before
After
Release notes
Notes: [Fixed] Files configured to use the binary merge driver are now treated as binary files when resolving conflicts.