aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Whitton2025-04-07 10:03:46 +0800
committerSean Whitton2025-04-07 10:03:46 +0800
commit7f60aa45aab4191a44d6d83ec6c3004e4901469b (patch)
treeba6eda3ab00ae927d17e5e2f65db1cbfa5749168
parentba13e7de32d08028ab7bffdd73dab271a95ea453 (diff)
downloademacs-7f60aa45aab4191a44d6d83ec6c3004e4901469b.tar.gz
emacs-7f60aa45aab4191a44d6d83ec6c3004e4901469b.zip
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.
-rw-r--r--lisp/vc/vc-git.el7
1 files 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."
1202 (with-temp-file patch-file 1202 (with-temp-file patch-file
1203 (insert vc-git-patch-string)) 1203 (insert vc-git-patch-string))
1204 (unwind-protect 1204 (unwind-protect
1205 (vc-git-command nil 0 patch-file "apply" "--cached") 1205 (vc-git-command nil 0 nil "apply" "--cached" patch-file)
1206 (delete-file patch-file)))) 1206 (delete-file patch-file))))
1207 (when to-stash (vc-git--stash-staged-changes files))) 1207 (when to-stash (vc-git--stash-staged-changes files)))
1208 ;; When operating on the whole tree, better pass "-a" than ".", 1208 ;; 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."
1228 (unwind-protect 1228 (unwind-protect
1229 (progn (with-temp-file cached 1229 (progn (with-temp-file cached
1230 (vc-git-command t 0 nil "stash" "show" "-p")) 1230 (vc-git-command t 0 nil "stash" "show" "-p"))
1231 (vc-git-command nil 0 cached "apply" "--cached")) 1231 (vc-git-command nil 0 nil "apply" "--cached" cached))
1232 (delete-file cached)) 1232 (delete-file cached))
1233 (vc-git-command nil 0 nil "stash" "drop"))))) 1233 (vc-git-command nil 0 nil "stash" "drop")))))
1234 1234
@@ -1259,7 +1259,8 @@ It is based on `log-edit-mode', and has Git-specific extensions."
1259 (unwind-protect 1259 (unwind-protect
1260 (progn 1260 (progn
1261 (vc-git-command nil 0 nil "read-tree" "HEAD") 1261 (vc-git-command nil 0 nil "read-tree" "HEAD")
1262 (vc-git-command nil 0 cached "apply" "--cached") 1262 (vc-git-command nil 0 nil "apply" "--cached"
1263 cached)
1263 (setq tree (git-string "write-tree"))) 1264 (setq tree (git-string "write-tree")))
1264 (delete-file index)))) 1265 (delete-file index))))
1265 (delete-file cached)) 1266 (delete-file cached))