aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Gutov2025-05-15 13:46:20 +0100
committerSean Whitton2025-05-15 13:46:20 +0100
commit511e3d4e798c70d4a9a6216e0c5ff04e36600ea7 (patch)
tree0bce52675e86a7cbff38fb48d4a982feec7c4f31
parentf70bb4d7677ba308bf15f445ecc99e30754bad84 (diff)
downloademacs-511e3d4e798c70d4a9a6216e0c5ff04e36600ea7.tar.gz
emacs-511e3d4e798c70d4a9a6216e0c5ff04e36600ea7.zip
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).
-rw-r--r--lisp/vc/vc-git.el8
1 files changed, 5 insertions, 3 deletions
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 53dedb05320..582de105c17 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."
1206 (with-temp-file patch-file 1206 (with-temp-file patch-file
1207 (insert vc-git-patch-string)) 1207 (insert vc-git-patch-string))
1208 (unwind-protect 1208 (unwind-protect
1209 (vc-git-command nil 0 nil "apply" "--cached" patch-file) 1209 (vc-git-command nil 0 nil "apply" "--cached"
1210 (file-local-name patch-file))
1210 (delete-file patch-file)))) 1211 (delete-file patch-file))))
1211 (when to-stash (vc-git--stash-staged-changes to-stash))) 1212 (when to-stash (vc-git--stash-staged-changes to-stash)))
1212 (let ((files (and only (not vc-git-patch-string) files)) 1213 (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."
1222 (progn 1223 (progn
1223 (with-temp-file cached 1224 (with-temp-file cached
1224 (vc-git-command t 0 nil "stash" "show" "-p")) 1225 (vc-git-command t 0 nil "stash" "show" "-p"))
1225 (vc-git-command nil 0 "apply" "--cached" cached)) 1226 (vc-git-command nil 0 "apply" "--cached"
1227 (file-local-name cached)))
1226 (delete-file cached)) 1228 (delete-file cached))
1227 (vc-git-command nil 0 nil "stash" "drop")))))) 1229 (vc-git-command nil 0 nil "stash" "drop"))))))
1228 (when msg-file 1230 (when msg-file
@@ -1281,7 +1283,7 @@ It is based on `log-edit-mode', and has Git-specific extensions."
1281 (progn 1283 (progn
1282 (vc-git-command nil 0 nil "read-tree" "HEAD") 1284 (vc-git-command nil 0 nil "read-tree" "HEAD")
1283 (vc-git-command nil 0 nil "apply" "--cached" 1285 (vc-git-command nil 0 nil "apply" "--cached"
1284 cached) 1286 (file-local-name cached))
1285 (setq tree (git-string "write-tree"))) 1287 (setq tree (git-string "write-tree")))
1286 (delete-file index)))) 1288 (delete-file index))))
1287 (delete-file cached)) 1289 (delete-file cached))