Name |
Last commit
|
Last update |
---|---|---|
.. | ||
binary.c | ||
blob.c | ||
diff_helpers.c | ||
diff_helpers.h | ||
diffiter.c | ||
drivers.c | ||
format_email.c | ||
index.c | ||
notify.c | ||
parse.c | ||
patch.c | ||
pathspec.c | ||
racediffiter.c | ||
rename.c | ||
stats.c | ||
submodules.c | ||
tree.c | ||
workdir.c |
In a diff, the shortest possible hunk with a modification (that is, no deletion) results from a file with only one line with a single character which is removed. Thus the following hunk @@ -1 +1 @@ -a + is the shortest valid hunk modifying a line. The function parsing the hunk body though assumes that there must always be at least 4 bytes present to make up a valid hunk, which is obviously wrong in this case. The absolute minimum number of bytes required for a modification is actually 2 bytes, that is the "+" and the following newline. Note: if there is no trailing newline, the assumption will not be offended as the diff will have a line "\ No trailing newline" at its end. This patch fixes the issue by lowering the amount of bytes required.
Name |
Last commit
|
Last update |
---|---|---|
.. | ||
binary.c | Loading commit data... | |
blob.c | Loading commit data... | |
diff_helpers.c | Loading commit data... | |
diff_helpers.h | Loading commit data... | |
diffiter.c | Loading commit data... | |
drivers.c | Loading commit data... | |
format_email.c | Loading commit data... | |
index.c | Loading commit data... | |
notify.c | Loading commit data... | |
parse.c | Loading commit data... | |
patch.c | Loading commit data... | |
pathspec.c | Loading commit data... | |
racediffiter.c | Loading commit data... | |
rename.c | Loading commit data... | |
stats.c | Loading commit data... | |
submodules.c | Loading commit data... | |
tree.c | Loading commit data... | |
workdir.c | Loading commit data... |