提交 74f5b7fb 编写于 作者: M Michele Ballabio 提交者: Junio C Hamano

builtin-merge.c: Fix option parsing

Now "git merge -m" needs a message, and errors out with the usage
text if none is given.
This way, t7600-merge.sh is fixed.
Signed-off-by: NMichele Ballabio <barra_cuda@katamail.com>
Acked-by: NMiklos Vajna <vmiklos@frugalware.org>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 ec96224e
......@@ -66,10 +66,11 @@ static int option_parse_message(const struct option *opt,
if (unset)
strbuf_setlen(buf, 0);
else {
else if (arg) {
strbuf_addf(buf, "%s\n\n", arg);
have_message = 1;
}
} else
return error("switch `m' requires a value");
return 0;
}
......
......@@ -221,7 +221,7 @@ test_expect_success 'setup' '
test_debug 'gitk --all'
test_expect_failure 'test option parsing' '
test_expect_success 'test option parsing' '
test_must_fail git merge -$ c1 &&
test_must_fail git merge --no-such c1 &&
test_must_fail git merge -s foobar c1 &&
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册