diff --git a/builtin/refs.c b/builtin/refs.c index 46dcd150d4..a51602f84b 100644 --- a/builtin/refs.c +++ b/builtin/refs.c @@ -30,9 +30,9 @@ static int cmd_refs_migrate(int argc, const char **argv, const char *prefix) argc = parse_options(argc, argv, prefix, options, migrate_usage, 0); if (argc) - usage(_("too many arguments")); + die(_("'git refs migrate' takes no arguments")); if (!format_str) - usage(_("missing --ref-format=")); + die(_("'git refs migrate' needs '--ref-format='")); format = ref_storage_format_by_name(format_str); if (format == REF_STORAGE_FORMAT_UNKNOWN) { diff --git a/t/t1460-refs-migrate.sh b/t/t1460-refs-migrate.sh index f7c0783d30..e063a98b11 100755 --- a/t/t1460-refs-migrate.sh +++ b/t/t1460-refs-migrate.sh @@ -31,20 +31,14 @@ test_expect_success "superfluous arguments" ' test_when_finished "rm -rf repo" && git init repo && test_must_fail git -C repo refs migrate foo 2>err && - cat >expect <<-EOF && - usage: too many arguments - EOF - test_cmp expect err + test_grep "takes no arguments" err ' test_expect_success "missing ref storage format" ' test_when_finished "rm -rf repo" && git init repo && test_must_fail git -C repo refs migrate 2>err && - cat >expect <<-EOF && - usage: missing --ref-format= - EOF - test_cmp expect err + test_grep "needs ${SQ}--ref-format=${SQ}" err ' test_expect_success "unknown ref storage format" '