Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
sequencer: report when noop has an argument
author
Johannes Schindelin
<johannes.schindelin@gmx.de>
Fri, 22 Dec 2017 23:55:57 +0000
(
00:55
+0100)
committer
Junio C Hamano
<gitster@pobox.com>
Wed, 27 Dec 2017 20:33:38 +0000
(12:33 -0800)
The noop command cannot accept any argument, but we never told the user
about any bogus argument. Fix that.
while at it, mention clearly when an argument is required but missing
(for commands *other* than noop).
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sequencer.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
5f8f927
)
diff --git
a/sequencer.c
b/sequencer.c
index e9fef58ba03da6f23c88f3f89ad3a11ea81752ca..b005e412a5b04ba6bf2df31157d01bbbe779fd27 100644
(file)
--- a/
sequencer.c
+++ b/
sequencer.c
@@
-1261,18
+1261,23
@@
static int parse_insn_line(struct todo_item *item, const char *bol, char *eol)
if (i >= TODO_COMMENT)
return -1;
if (i >= TODO_COMMENT)
return -1;
+ /* Eat up extra spaces/ tabs before object name */
+ padding = strspn(bol, " \t");
+ bol += padding;
+
if (item->command == TODO_NOOP) {
if (item->command == TODO_NOOP) {
+ if (bol != eol)
+ return error(_("%s does not accept arguments: '%s'"),
+ command_to_string(item->command), bol);
item->commit = NULL;
item->arg = bol;
item->arg_len = eol - bol;
return 0;
}
item->commit = NULL;
item->arg = bol;
item->arg_len = eol - bol;
return 0;
}
- /* Eat up extra spaces/ tabs before object name */
- padding = strspn(bol, " \t");
if (!padding)
if (!padding)
- return
-1;
-
bol += padding
;
+ return
error(_("missing arguments for %s"),
+
command_to_string(item->command))
;
if (item->command == TODO_EXEC) {
item->commit = NULL;
if (item->command == TODO_EXEC) {
item->commit = NULL;