Make reverting work with unclean working trees.

* magit.el (magit-revert-item): Like with magit-apply-item, use diff
plus apply instead of revert so that we can work with a unclean working tree.
This commit is contained in:
Marius Vollmer 2008-08-30 22:47:43 +03:00
parent c1cce797d0
commit 12ae7132c4

View file

@ -1075,8 +1075,8 @@ Please see the manual for a complete description of Magit.
(magit-item-case (item info "revert")
((commit)
(magit-append-to-log-edit
(magit-format-commit info "Reverting %h, %s"))
(magit-run "git" "revert" "--no-commit" info))))
(magit-format-commit info "Reverting \"%s\""))
(magit-run-shell "git diff %s^ %s | git apply --reverse -" info info))))
(defvar magit-currently-shown-commit nil)