branch: externals/diff-hl
commit a7b59bc681e027bf99d1e3cd9475f53ea90b9b11
Author: Dmitry Gutov <[email protected]>
Commit: Dmitry Gutov <[email protected]>

    Make sure diff-hl-revert-hunk supports buffer-local reference revision
---
 diff-hl.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/diff-hl.el b/diff-hl.el
index 362611822c..72a325f368 100644
--- a/diff-hl.el
+++ b/diff-hl.el
@@ -980,8 +980,9 @@ that file, if it's present."
       (unwind-protect
           (progn
             (vc-setup-buffer diff-buffer)
-            (diff-hl-diff-against-reference file backend diff-buffer)
-            (set-buffer diff-buffer)
+            (with-current-buffer buffer
+              ;; Ensure that the buffer-local variable value is applied.
+              (diff-hl-diff-against-reference file backend diff-buffer))
             (diff-mode)
             (setq-local diff-vc-backend backend)
             (setq-local diff-vc-revisions (list diff-hl-reference-revision 
nil))

Reply via email to