It happens from time to time to type -amend (with a single
dash) when --amend is meant. In those case there is no mistake
and git commit all files modified with the log message set
to "end". As -amend is just doing something stupid it is
better to check for this wrong usage and give hint to the
user about the possible mistake.
Signed-off-by: Pascal Obry <redacted>
---
parse-options.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/parse-options.c b/parse-options.c
index 7a08a0c..248515d 100644
--- a/parse-options.c
+++ b/parse-options.c
@@ -233,6 +233,13 @@ int parse_options(int argc, const char **argv, const struct option *options,
continue;
}
+ if (!strcmp(arg + 1, "amend")) {
+ error("-amend looks suspicious, don't you meant --amend\n");
+ args.argc--;
+ args.argv++;
+ break;
+ }
+
if (arg[1] != '-') {
args.opt = arg + 1;
do {--
1.5.4.rc4.23.gcab31