Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork942
Commit25f27c8
committed
Split diff line by '\t' for metadata and path
This protects against `.split(None)` which uses consecutive whitespaceas a separator to overlook paths where a single space is the filename.For example, in this diff line:line = ':100644 000000e69de290000000000000000000000000000000000000000 D 'The deleted file is a file named ' ' (just one space). It's entirelypossible to commit this, remove, and to produce the following outputfrom `git diff`:git diff --name-status <SHA1> <SHA2>DM path/to/another/file.py...This would cause the initial `.split(None, 5)` to fail as it will countall consecutive whitespace as a separator, disregarding the ' ' (singlespace) filename.1 parentb297148 commit25f27c8
1 file changed
+2
-1
lines changedLines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
365 | 365 |
| |
366 | 366 |
| |
367 | 367 |
| |
368 |
| - | |
| 368 | + | |
| 369 | + | |
369 | 370 |
| |
370 | 371 |
| |
371 | 372 |
| |
|
0 commit comments
Comments
(0)