Make 'a' and 'v' work with whole diffs.

* magit.el (magit-apply-diff-item): Actually use *magit-tmp* as input
when running the command, instead of ignoring it.  D'oh.
This commit is contained in:
Marius Vollmer 2009-07-15 00:42:33 +03:00
parent ad04fba40a
commit bd8fca2fb7

View file

@ -1680,10 +1680,12 @@ Please see the manual for a complete description of Magit.
(defun magit-apply-diff-item (diff &rest args) (defun magit-apply-diff-item (diff &rest args)
(when (zerop magit-diff-context-lines) (when (zerop magit-diff-context-lines)
(setq args (cons "--unidiff-zero" args))) (setq args (cons "--unidiff-zero" args)))
(with-current-buffer (get-buffer-create "*magit-tmp*") (let ((tmp (get-buffer-create "*magit-tmp*")))
(erase-buffer)) (with-current-buffer tmp
(magit-insert-diff-item-patch diff "*magit-tmp*") (erase-buffer))
(apply #'magit-run-git "apply" (append args (list "-")))) (magit-insert-diff-item-patch diff "*magit-tmp*")
(apply #'magit-run-git-with-input tmp
"apply" (append args (list "-")))))
(defun magit-apply-hunk-item* (hunk reverse &rest args) (defun magit-apply-hunk-item* (hunk reverse &rest args)
(when (zerop magit-diff-context-lines) (when (zerop magit-diff-context-lines)