From: Dmitry Gutov Date: Thu, 15 May 2025 12:46:20 +0000 (+0100) Subject: vc-git-checkin: Fix calling 'git apply --cached' remotely X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=32332394ec8fe74de09f1a98819439d542dcc640;p=emacs.git vc-git-checkin: Fix calling 'git apply --cached' remotely * lisp/vc/vc-git.el (vc-git-checkin) (vc-git--stash-staged-changes): Fix calling 'git apply --cached' remotely (bug#78405). (cherry picked from commit 511e3d4e798c70d4a9a6216e0c5ff04e36600ea7) --- diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index b6b286ee584..3e9d0b2841c 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -1206,7 +1206,8 @@ 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 nil "apply" "--cached" patch-file) + (vc-git-command nil 0 nil "apply" "--cached" + (file-local-name patch-file)) (delete-file patch-file)))) (when to-stash (vc-git--stash-staged-changes to-stash))) (let ((files (and only (not vc-git-patch-string) files)) @@ -1222,7 +1223,8 @@ It is based on `log-edit-mode', and has Git-specific extensions." (progn (with-temp-file cached (vc-git-command t 0 nil "stash" "show" "-p")) - (vc-git-command nil 0 "apply" "--cached" cached)) + (vc-git-command nil 0 "apply" "--cached" + (file-local-name cached))) (delete-file cached)) (vc-git-command nil 0 nil "stash" "drop")))))) (when msg-file @@ -1281,7 +1283,7 @@ It is based on `log-edit-mode', and has Git-specific extensions." (progn (vc-git-command nil 0 nil "read-tree" "HEAD") (vc-git-command nil 0 nil "apply" "--cached" - cached) + (file-local-name cached)) (setq tree (git-string "write-tree"))) (delete-file index)))) (delete-file cached))