@matheusbsbs / matheus-bagliano / commits / 5b4e44104e
Fork 0

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: Alexandre Julliard <julliard@winehq.org>

Alexandre Julliard committed Feb 16, 2009 at 11:40 UTC 5b4e44104ea9f933e461ed7d3ce4a05a00d95dbb
1 file changed +6 -2
contrib/emacs/git.el
+6 -2
@@ -1068,7 +1068,9 @@ The FILES list must be sorted."
1068 (unless files
1069 (push (file-relative-name (read-file-name "File to remove: " nil nil t)) files))
1070 (if (yes-or-no-p
1071 - (format "Remove %d file%s? " (length files) (if (> (length files) 1) "s" "")))
1071 + (if (cdr files)
1072 + (format "Remove %d files? " (length files))
1073 + (format "Remove %s? " (car files))))
1074 (progn
1075 (dolist (name files)
1076 (ignore-errors
@@ -1087,7 +1089,9 @@ The FILES list must be sorted."
1089 added modified)
1090 (when (and files
1091 (yes-or-no-p
1090 - (format "Revert %d file%s? " (length files) (if (> (length files) 1) "s" ""))))
1092 + (if (cdr files)
1093 + (format "Revert %d files? " (length files))
1094 + (format "Revert %s? " (git-fileinfo->name (car files))))))
1095 (dolist (info files)
1096 (case (git-fileinfo->state info)
1097 ('added (push (git-fileinfo->name info) added))