From 75fd5269809c5092781531379e7ca47673811080 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Thu, 16 Apr 2026 16:08:36 -0400 Subject: [PATCH] ; Fix last change. --- lisp/vc/vc.el | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 344e1c012ac..f25067f3660 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -5075,19 +5075,19 @@ called from Lisp with optional argument OK-IF-ALREADY-EXISTS non-nil." (unless (memq state '(up-to-date edited added)) (error "Please %s files before moving them" (if (stringp state) "check in" "update"))))) - (let ((backend (if dirp - (vc-responsible-backend old) - (vc-backend old)))) - ;; The rename commands for several VCS (at least Bzr, Git and - ;; Mercurial) will fail if asked to move a directory containing - ;; only untracked files. So skip calling into the backend if OLD - ;; is a directory and we walk through the entirety of it without - ;; finding any VC-managed files. - (unless (and dirp - (catch 'done - (vc-file-tree-walk old (lambda (_) (throw 'done nil))) - t)) - (vc-call-backend backend 'rename-file old new))) + ;; The rename commands for several VCS (at least Bzr, Git and + ;; Mercurial) will fail if asked to move a directory containing + ;; only untracked files. So skip calling into the backend if OLD + ;; is a directory and we walk through the entirety of it without + ;; finding any VC-managed files. + (unless (and dirp + (catch 'done + (vc-file-tree-walk old (lambda (_) (throw 'done nil))) + t)) + (vc-call-backend (if dirp + (vc-responsible-backend old) + (vc-backend old)) + 'rename-file old new)) (vc-file-clearprops old) (vc-file-clearprops new) ;; Move the actual file (unless the backend did it already)