summaryrefslogtreecommitdiff
path: root/builtin/merge-file.c
diff options
context:
space:
mode:
authorBeat Bolli <dev+git@drbeat.li>2015-11-23 22:32:12 +0100
committerJeff King <peff@peff.net>2015-11-24 18:55:26 -0500
commit3c6de746bd461705fdaa6113085e62fb55705049 (patch)
treec58b4719d19f416304a5cf0d258f4c06a73905a5 /builtin/merge-file.c
parent5cb2e162d21fa45a63f186b31970e2e9c9b10ba9 (diff)
downloadgit-bb/merge-marker-crlf.tar.gz
merge-file: consider core.crlf when writing merge markersbb/merge-marker-crlf
When merging files in repos with core.eol = crlf, git merge-file inserts just a LF at the end of the merge markers. Files with mixed line endings cause trouble in Windows editors and e.g. contrib/git-jump, where an unmerged file in a run of "git jump merge" is reported as simply "binary file matches". Fixing this improves Git's behavior under Windows. Signed-off-by: Beat Bolli <dev+git@drbeat.li> Cc: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Jeff King <peff@peff.net>
Diffstat (limited to 'builtin/merge-file.c')
-rw-r--r--builtin/merge-file.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/builtin/merge-file.c b/builtin/merge-file.c
index 55447053f2..c534c91f44 100644
--- a/builtin/merge-file.c
+++ b/builtin/merge-file.c
@@ -81,6 +81,7 @@ int cmd_merge_file(int argc, const char **argv, const char *prefix)
argv[i]);
}
+ xmp.crlf = (core_eol == EOL_CRLF);
xmp.ancestor = names[1];
xmp.file1 = names[0];
xmp.file2 = names[2];