diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-06-28 22:53:32 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-06-28 22:53:32 +0300 |
commit | 5eb8da850860839bdf38ab80079eb8875b764431 (patch) | |
tree | a2156eaf3bd403dd7b1ac4e78412dba283fa78fa /git-add--interactive.perl | |
parent | 0079732e960dc20ab2a68043d5593de358f1377f (diff) | |
parent | f4d35a6b49621348c73222e7017a434551799308 (diff) |
Merge branch 'pw/add-p-recount'
When user edits the patch in "git add -p" and the user's editor is
set to strip trailing whitespaces indiscriminately, an empty line
that is unchanged in the patch would become completely empty
(instead of a line with a sole SP on it). The code introduced in
Git 2.17 timeframe failed to parse such a patch, but now it learned
to notice the situation and cope with it.
* pw/add-p-recount:
add -p: fix counting empty context lines in edited patches
Diffstat (limited to 'git-add--interactive.perl')
-rwxr-xr-x | git-add--interactive.perl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/git-add--interactive.perl b/git-add--interactive.perl index 36f38ced90..20eb81cc92 100755 --- a/git-add--interactive.perl +++ b/git-add--interactive.perl @@ -1062,7 +1062,7 @@ sub recount_edited_hunk { $o_cnt++; } elsif ($mode eq '+') { $n_cnt++; - } elsif ($mode eq ' ') { + } elsif ($mode eq ' ' or $mode eq "\n") { $o_cnt++; $n_cnt++; } |