Skip to content

Commit a7b59bc

Browse files
committed
Make sure diff-hl-revert-hunk supports buffer-local reference revision
1 parent 4548d29 commit a7b59bc

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

diff-hl.el

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -980,8 +980,9 @@ that file, if it's present."
980980
(unwind-protect
981981
(progn
982982
(vc-setup-buffer diff-buffer)
983-
(diff-hl-diff-against-reference file backend diff-buffer)
984-
(set-buffer diff-buffer)
983+
(with-current-buffer buffer
984+
;; Ensure that the buffer-local variable value is applied.
985+
(diff-hl-diff-against-reference file backend diff-buffer))
985986
(diff-mode)
986987
(setq-local diff-vc-backend backend)
987988
(setq-local diff-vc-revisions (list diff-hl-reference-revision nil))

0 commit comments

Comments
 (0)