From 022facd986191364a6487ab2a434238dea536ed3 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Fri, 5 Dec 2025 17:05:47 +0000 Subject: [PATCH] * lisp/vc/diff-mode.el (diff-revert-and-kill-hunk): Fix finding END. --- lisp/vc/diff-mode.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el index 05b0d10ef90..6254dc50d84 100644 --- a/lisp/vc/diff-mode.el +++ b/lisp/vc/diff-mode.el @@ -2304,7 +2304,8 @@ BEG and END." (goto-char beg) (setq beg (car (diff-bounds-of-hunk))) (goto-char end) - (setq end (cadr (diff-bounds-of-hunk)))) + (unless (looking-at diff-hunk-header-re) + (setq end (cadr (diff-bounds-of-hunk))))) (pcase-setq `(,beg ,end) (diff-bounds-of-hunk))) (when (null (diff-apply-buffer beg end t)) ;; Use `diff-hunk-kill' because it properly handles file headers.