]> git.eshelyaron.com Git - emacs.git/commitdiff
vc-git-checkin: Fix calling 'git apply --cached' remotely
authorDmitry Gutov <dmitry@gutov.dev>
Thu, 15 May 2025 12:46:20 +0000 (13:46 +0100)
committerEshel Yaron <me@eshelyaron.com>
Tue, 20 May 2025 20:51:32 +0000 (22:51 +0200)
* 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)

lisp/vc/vc-git.el

index b6b286ee5846aa635cd657f55bf3514fad60ce56..3e9d0b2841ce3811e4515a2851c811fcc7aad30c 100644 (file)
@@ -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))