From bd8fca2fb70b0846c53f28482f2c1bd96c1282d7 Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Wed, 15 Jul 2009 00:42:33 +0300 Subject: [PATCH] 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. --- magit.el | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/magit.el b/magit.el index 4099ae31..063468b3 100644 --- a/magit.el +++ b/magit.el @@ -1680,10 +1680,12 @@ Please see the manual for a complete description of Magit. (defun magit-apply-diff-item (diff &rest args) (when (zerop magit-diff-context-lines) (setq args (cons "--unidiff-zero" args))) - (with-current-buffer (get-buffer-create "*magit-tmp*") - (erase-buffer)) - (magit-insert-diff-item-patch diff "*magit-tmp*") - (apply #'magit-run-git "apply" (append args (list "-")))) + (let ((tmp (get-buffer-create "*magit-tmp*"))) + (with-current-buffer tmp + (erase-buffer)) + (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) (when (zerop magit-diff-context-lines)