1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-28 08:11:05 -08:00

Delete duplicate bindings of default-directory

* lisp/vc/vc.el (vc-root-version-diff, vc-diff-mergebase)
(vc-root-diff-incoming, vc-root-diff-outgoing, vc-root-diff):
Delete duplicate bindings of default-directory.
vc--with-backend-in-rootdir already establishes bindings.
This commit is contained in:
Sean Whitton 2025-08-17 11:10:14 +01:00
parent 6f7e795ce1
commit 70b5ad0192

View file

@ -2456,9 +2456,8 @@ state of each file in the fileset."
(when (and (not rev1) rev2)
(error "Not a valid revision range"))
(vc--with-backend-in-rootdir "VC root-diff"
(let ((default-directory rootdir))
(vc-diff-internal vc-allow-async-diff (list backend (list rootdir)) rev1 rev2
(called-interactively-p 'interactive)))))
(vc-diff-internal vc-allow-async-diff (list backend (list rootdir)) rev1 rev2
(called-interactively-p 'interactive))))
;;;###autoload
(defun vc-diff (&optional historic not-essential fileset)
@ -2531,8 +2530,7 @@ The merge base is a common ancestor between REV1 and REV2 revisions."
(when (and (not rev1) rev2)
(error "Not a valid revision range"))
(vc--with-backend-in-rootdir "VC root-diff"
(let ((default-directory rootdir)
(rev1 (vc-call-backend backend 'mergebase rev1 rev2)))
(let ((rev1 (vc-call-backend backend 'mergebase rev1 rev2)))
(vc-diff-internal
vc-allow-async-diff (list backend (list rootdir)) rev1 rev2
(called-interactively-p 'interactive)))))
@ -2548,8 +2546,7 @@ See `vc-use-incoming-outgoing-prefixes' regarding giving this command a
global binding."
(interactive (list (vc--maybe-read-remote-location)))
(vc--with-backend-in-rootdir "VC root-diff"
(let ((default-directory rootdir)
(incoming (vc--incoming-revision backend
(let ((incoming (vc--incoming-revision backend
(or remote-location ""))))
(vc-diff-internal vc-allow-async-diff (list backend (list rootdir))
(vc-call-backend backend 'mergebase incoming)
@ -2572,8 +2569,7 @@ global binding."
;; (Hence why we don't call `vc-buffer-sync-fileset'.)
(interactive (list (vc--maybe-read-remote-location)))
(vc--with-backend-in-rootdir "VC root-diff"
(let ((default-directory rootdir)
(incoming (vc--incoming-revision backend
(let ((incoming (vc--incoming-revision backend
(or remote-location ""))))
(vc-diff-internal vc-allow-async-diff (list backend (list rootdir))
(vc-call-backend backend 'mergebase incoming)
@ -2674,8 +2670,7 @@ saving the buffer."
;; relative to it. Bind default-directory to the root directory
;; here, this way the *vc-diff* buffer is setup correctly, so
;; relative file names work.
(let ((default-directory rootdir)
(fileset `(,backend (,rootdir))))
(let ((fileset `(,backend (,rootdir))))
(vc-buffer-sync-fileset fileset not-essential)
(vc-diff-internal vc-allow-async-diff fileset nil nil
(called-interactively-p 'interactive))))))