Fixes regex for timestamps to when behind GMT

Currently, a timezone that ends in say '+0200' will get stripped, but a
timezone _behind_ GMT will not (so a timezone in the United States of
say, '-0400' will **not** get stripped.

This regex change fixes that.
This commit is contained in:
romellem 2017-10-09 09:25:02 -05:00
parent ea43094ed6
commit 5215321466
2 changed files with 1 additions and 3 deletions

View file

@ -435,7 +435,7 @@
// Cleanup timestamps generated by the unified diff (diff command) as specified in
// https://www.gnu.org/software/diffutils/manual/html_node/Detailed-Unified.html
// Ie: 2016-10-25 11:37:14.000000000 +0200
filename = filename.replace(/\s+\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}(?:\.\d+)? \+\d{4}.*$/, '');
filename = filename.replace(/\s+\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}(?:\.\d+)? [-+]\d{4}.*$/, '');
}
return filename;

View file

@ -432,8 +432,6 @@ describe('DiffParser', function() {
});
assert.deepEqual(linesContent, ['-test', '+test1r', '+test2r']);
});
});
it('should parse unified non git diff', function() {