[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 150fc9c 1/2: Do not count git markers as "deleted lines"
From: |
Lars Ingebrigtsen |
Subject: |
master 150fc9c 1/2: Do not count git markers as "deleted lines" |
Date: |
Thu, 23 Sep 2021 17:33:45 -0400 (EDT) |
branch: master
commit 150fc9c8458281fd281da37728515afb4640a650
Author: Konstantin Kharlamov <Hi-Angel@yandex.ru>
Commit: Lars Ingebrigtsen <larsi@gnus.org>
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).
---
lisp/vc/diff-mode.el | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el
index 0852f87..057ffcd 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