提交 5b4e4410 编写于 作者: A Alexandre Julliard

git.el: Improve the confirmation message on remove and revert.

If there's only one file, print its name instead of just "1 file".
Signed-off-by: NAlexandre Julliard <julliard@winehq.org>
上级 21ba0e84
......@@ -1068,7 +1068,9 @@ The FILES list must be sorted."
(unless files
(push (file-relative-name (read-file-name "File to remove: " nil nil t)) files))
(if (yes-or-no-p
(format "Remove %d file%s? " (length files) (if (> (length files) 1) "s" "")))
(if (cdr files)
(format "Remove %d files? " (length files))
(format "Remove %s? " (car files))))
(progn
(dolist (name files)
(ignore-errors
......@@ -1087,7 +1089,9 @@ The FILES list must be sorted."
added modified)
(when (and files
(yes-or-no-p
(format "Revert %d file%s? " (length files) (if (> (length files) 1) "s" ""))))
(if (cdr files)
(format "Revert %d files? " (length files))
(format "Revert %s? " (git-fileinfo->name (car files))))))
(dolist (info files)
(case (git-fileinfo->state info)
('added (push (git-fileinfo->name info) added))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册