From 7f60aa45aab4191a44d6d83ec6c3004e4901469b Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Mon, 7 Apr 2025 10:03:46 +0800 Subject: [PATCH] vc-git-checkin: Don't relativize names of temporary files * lisp/vc/vc-git.el (vc-git-checkin) (vc-git--stash-staged-changes): Don't relativize names of temporary files passed to 'git apply --cached'. More generally, these are not files managed by the underlying VCS, so they shouldn't go in the FILE-OR-LIST argument to vc-git-command. --- lisp/vc/vc-git.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 932dddaefbb..869e9737422 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -1202,7 +1202,7 @@ It is based on `log-edit-mode', and has Git-specific extensions." (with-temp-file patch-file (insert vc-git-patch-string)) (unwind-protect - (vc-git-command nil 0 patch-file "apply" "--cached") + (vc-git-command nil 0 nil "apply" "--cached" patch-file) (delete-file patch-file)))) (when to-stash (vc-git--stash-staged-changes files))) ;; When operating on the whole tree, better pass "-a" than ".", @@ -1228,7 +1228,7 @@ It is based on `log-edit-mode', and has Git-specific extensions." (unwind-protect (progn (with-temp-file cached (vc-git-command t 0 nil "stash" "show" "-p")) - (vc-git-command nil 0 cached "apply" "--cached")) + (vc-git-command nil 0 nil "apply" "--cached" cached)) (delete-file cached)) (vc-git-command nil 0 nil "stash" "drop"))))) @@ -1259,7 +1259,8 @@ It is based on `log-edit-mode', and has Git-specific extensions." (unwind-protect (progn (vc-git-command nil 0 nil "read-tree" "HEAD") - (vc-git-command nil 0 cached "apply" "--cached") + (vc-git-command nil 0 nil "apply" "--cached" + cached) (setq tree (git-string "write-tree"))) (delete-file index)))) (delete-file cached))