help: make help_unknown_ref() NORETURN
[gitweb.git] / git-add--interactive.perl
index 36f38ced902e1902a626933bdcda09819acf39a7..da5b4ec4bc50e4e3adaba0f25820262b6a7436a0 100755 (executable)
@@ -972,7 +972,11 @@ sub coalesce_overlapping_hunks {
                        next;
                }
                if ($ofs_delta) {
-                       $n_ofs += $ofs_delta;
+                       if ($patch_mode_flavour{IS_REVERSE}) {
+                               $o_ofs -= $ofs_delta;
+                       } else {
+                               $n_ofs += $ofs_delta;
+                       }
                        $_->{TEXT}->[0] = format_hunk_header($o_ofs, $o_cnt,
                                                             $n_ofs, $n_cnt);
                }
@@ -1062,7 +1066,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++;
                }