Skip to content

Commit 033967b

Browse files
author
Rachel Macfarlane
committed
Fix line ending regex, fixes #260
1 parent 2a2cfde commit 033967b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/common/diffHunk.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ function parsePatch(patch: string): DiffHunk[] {
194194
}
195195

196196
export function getModifiedContentFromDiffHunk(originalContent, patch) {
197-
let left = originalContent.split(/\r|\n|\r\n/);
197+
let left = originalContent.split(/\r?\n/);
198198
let diffHunkReader = parseDiffHunk(patch);
199199
let diffHunkIter = diffHunkReader.next();
200200
let diffHunks = [];

src/common/repository.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ export class Repository {
237237
return [];
238238
}
239239

240-
return result.stdout.trimRight().split(/\r|\n|\r\n/).map(branchName => {
240+
return result.stdout.trimRight().split(/\r?\n/).map(branchName => {
241241
return branchName.substr(2);
242242
});
243243
}

0 commit comments

Comments
 (0)