Merge branch 'ms/remote-error-message-update'

Update error messages given by "git remote" and make them consistent.

* ms/remote-error-message-update:
  builtin/remote: quote remote name on error to display empty name
This commit is contained in:
Junio C Hamano 2018-09-24 10:30:52 -07:00
commit 00d5f665a0
2 changed files with 5 additions and 5 deletions

View File

@ -626,7 +626,7 @@ static int mv(int argc, const char **argv)
oldremote = remote_get(rename.old_name); oldremote = remote_get(rename.old_name);
if (!remote_is_configured(oldremote, 1)) if (!remote_is_configured(oldremote, 1))
die(_("No such remote: %s"), rename.old_name); die(_("No such remote: '%s'"), rename.old_name);
if (!strcmp(rename.old_name, rename.new_name) && oldremote->origin != REMOTE_CONFIG) if (!strcmp(rename.old_name, rename.new_name) && oldremote->origin != REMOTE_CONFIG)
return migrate_file(oldremote); return migrate_file(oldremote);
@ -762,7 +762,7 @@ static int rm(int argc, const char **argv)
remote = remote_get(argv[1]); remote = remote_get(argv[1]);
if (!remote_is_configured(remote, 1)) if (!remote_is_configured(remote, 1))
die(_("No such remote: %s"), argv[1]); die(_("No such remote: '%s'"), argv[1]);
known_remotes.to_delete = remote; known_remotes.to_delete = remote;
for_each_remote(add_known_remote, &known_remotes); for_each_remote(add_known_remote, &known_remotes);
@ -861,7 +861,7 @@ static int get_remote_ref_states(const char *name,
states->remote = remote_get(name); states->remote = remote_get(name);
if (!states->remote) if (!states->remote)
return error(_("No such remote: %s"), name); return error(_("No such remote: '%s'"), name);
read_branches(); read_branches();

View File

@ -145,7 +145,7 @@ test_expect_success 'remove remote protects local branches' '
test_expect_success 'remove errors out early when deleting non-existent branch' ' test_expect_success 'remove errors out early when deleting non-existent branch' '
( (
cd test && cd test &&
echo "fatal: No such remote: foo" >expect && echo "fatal: No such remote: '\''foo'\''" >expect &&
test_must_fail git remote rm foo 2>actual && test_must_fail git remote rm foo 2>actual &&
test_i18ncmp expect actual test_i18ncmp expect actual
) )
@ -173,7 +173,7 @@ test_expect_success 'remove remote with a branch without configured merge' '
test_expect_success 'rename errors out early when deleting non-existent branch' ' test_expect_success 'rename errors out early when deleting non-existent branch' '
( (
cd test && cd test &&
echo "fatal: No such remote: foo" >expect && echo "fatal: No such remote: '\''foo'\''" >expect &&
test_must_fail git remote rename foo bar 2>actual && test_must_fail git remote rename foo bar 2>actual &&
test_i18ncmp expect actual test_i18ncmp expect actual
) )