We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3ae011b commit bbfabfdCopy full SHA for bbfabfd
git/add.py
@@ -59,7 +59,7 @@ def cull_diff(self, result):
59
hunks = [{"diff": ""}]
60
i = 0
61
matcher = re.compile('^@@ -([0-9]*)(?:,([0-9]*))? \+([0-9]*)(?:,([0-9]*))? @@')
62
- for line in result.splitlines():
+ for line in result.splitlines(keepends=True): # if different line endings, patch will not apply
63
if line.startswith('@@'):
64
i += 1
65
match = matcher.match(line)
@@ -70,7 +70,7 @@ def cull_diff(self, result):
70
else:
71
end = start
72
hunks.append({"diff": "", "start": start, "end": end})
73
- hunks[i]["diff"] += line + "\n"
+ hunks[i]["diff"] += line
74
75
diffs = hunks[0]["diff"]
76
hunks.pop(0)
0 commit comments