mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-30 04:10:54 -08:00
vc-git-checkin: Don't try to apply an empty patch
* lisp/vc/vc-git.el (vc-git-checkin): Don't try to apply an empty
patch to the index, because in that case 'git apply' fails.
(cherry picked from commit 1424342225)
This commit is contained in:
parent
0754173c92
commit
baaa9f42e5
1 changed files with 7 additions and 6 deletions
|
|
@ -1041,12 +1041,13 @@ It is based on `log-edit-mode', and has Git-specific extensions."
|
|||
(string-replace file-diff "" vc-git-patch-string))
|
||||
(user-error "Index not empty"))
|
||||
(setq pos (point))))))
|
||||
(let ((patch-file (make-nearby-temp-file "git-patch")))
|
||||
(with-temp-file patch-file
|
||||
(insert vc-git-patch-string))
|
||||
(unwind-protect
|
||||
(vc-git-command nil 0 patch-file "apply" "--cached")
|
||||
(delete-file patch-file))))
|
||||
(unless (string-empty-p vc-git-patch-string)
|
||||
(let ((patch-file (make-nearby-temp-file "git-patch")))
|
||||
(with-temp-file patch-file
|
||||
(insert vc-git-patch-string))
|
||||
(unwind-protect
|
||||
(vc-git-command nil 0 patch-file "apply" "--cached")
|
||||
(delete-file patch-file)))))
|
||||
(cl-flet ((boolean-arg-fn
|
||||
(argument)
|
||||
(lambda (value) (when (equal value "yes") (list argument)))))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue