]> git.eshelyaron.com Git - emacs.git/commitdiff
vc-git-checkin: Don't relativize names of temporary files
authorSean Whitton <spwhitton@spwhitton.name>
Mon, 7 Apr 2025 02:03:46 +0000 (10:03 +0800)
committerEshel Yaron <me@eshelyaron.com>
Tue, 8 Apr 2025 05:46:51 +0000 (07:46 +0200)
* 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.

(cherry picked from commit 7f60aa45aab4191a44d6d83ec6c3004e4901469b)

lisp/vc/vc-git.el

index 6672c25e4f83188a23e12d62133e70517755264d..0a85874c3b3cbe298cf47da760a1168437ae1202 100644 (file)
@@ -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))