summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorKonstantin Kharlamov <Hi-Angel@yandex.ru>2021-09-23 23:25:41 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2021-09-23 23:25:41 +0200
commit150fc9c8458281fd281da37728515afb4640a650 (patch)
treec3b2a60819b5aae818fe50c0ccf57207f3455355 /lisp
parent66d15137629a5224e16a0269e0e3181500962de2 (diff)
downloademacs-150fc9c8458281fd281da37728515afb4640a650.tar.gz
emacs-150fc9c8458281fd281da37728515afb4640a650.tar.bz2
emacs-150fc9c8458281fd281da37728515afb4640a650.zip
Do not count git markers as "deleted lines"
* lisp/vc/diff-mode.el (diff-fixup-modifs): Skip "end of patch" markers that `git-format-patch` leaves around (bug#50761).
Diffstat (limited to 'lisp')
-rw-r--r--lisp/vc/diff-mode.el6
1 files changed, 5 insertions, 1 deletions
diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el
index 0852f8790e9..057ffcd06e3 100644
--- a/lisp/vc/diff-mode.el
+++ b/lisp/vc/diff-mode.el
@@ -1355,7 +1355,11 @@ else cover the whole buffer."
(pcase (char-after)
(?\s (cl-incf space))
(?+ (cl-incf plus))
- (?- (cl-incf minus))
+ (?- (unless ;; In git format-patch "^-- $" signifies
+ ;; the end of the patch.
+ (and (eq diff-buffer-type 'git)
+ (looking-at "^-- $"))
+ (cl-incf minus)))
(?! (cl-incf bang))
((or ?\\ ?#) nil)
(?\n (if diff-valid-unified-empty-line