Improve message when discarding changes in a region.
* magit.el (magit-discard-item): Here.
This commit is contained in:
parent
b523d9c15e
commit
35ea9ab265
1 changed files with 6 additions and 2 deletions
8
magit.el
8
magit.el
|
@ -2640,12 +2640,16 @@ Prefix arg means justify as well."
|
||||||
(if (yes-or-no-p "Delete all untracked files and directories? ")
|
(if (yes-or-no-p "Delete all untracked files and directories? ")
|
||||||
(magit-run "git" "clean" "-df")))
|
(magit-run "git" "clean" "-df")))
|
||||||
((unstaged diff hunk)
|
((unstaged diff hunk)
|
||||||
(when (yes-or-no-p "Discard hunk? ")
|
(when (yes-or-no-p (if (magit-use-region-p)
|
||||||
|
"Discard changes in region? "
|
||||||
|
"Discard hunk? "))
|
||||||
(magit-apply-hunk-item-reverse item)))
|
(magit-apply-hunk-item-reverse item)))
|
||||||
((staged diff hunk)
|
((staged diff hunk)
|
||||||
(if (magit-file-uptodate-p (magit-diff-item-file
|
(if (magit-file-uptodate-p (magit-diff-item-file
|
||||||
(magit-hunk-item-diff item)))
|
(magit-hunk-item-diff item)))
|
||||||
(when (yes-or-no-p "Discard hunk? ")
|
(when (yes-or-no-p (if (magit-use-region-p)
|
||||||
|
"Discard changes in region? "
|
||||||
|
"Discard hunk? "))
|
||||||
(magit-apply-hunk-item-reverse item "--index"))
|
(magit-apply-hunk-item-reverse item "--index"))
|
||||||
(error "Can't discard this hunk. Please unstage it first.")))
|
(error "Can't discard this hunk. Please unstage it first.")))
|
||||||
((unstaged diff)
|
((unstaged diff)
|
||||||
|
|
Loading…
Add table
Reference in a new issue