Skip to content

Commit 00d5f66

Browse files
committed
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
2 parents ee99ba7 + 5025425 commit 00d5f66

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

builtin/remote.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ static int mv(int argc, const char **argv)
626626

627627
oldremote = remote_get(rename.old_name);
628628
if (!remote_is_configured(oldremote, 1))
629-
die(_("No such remote: %s"), rename.old_name);
629+
die(_("No such remote: '%s'"), rename.old_name);
630630

631631
if (!strcmp(rename.old_name, rename.new_name) && oldremote->origin != REMOTE_CONFIG)
632632
return migrate_file(oldremote);
@@ -762,7 +762,7 @@ static int rm(int argc, const char **argv)
762762

763763
remote = remote_get(argv[1]);
764764
if (!remote_is_configured(remote, 1))
765-
die(_("No such remote: %s"), argv[1]);
765+
die(_("No such remote: '%s'"), argv[1]);
766766

767767
known_remotes.to_delete = remote;
768768
for_each_remote(add_known_remote, &known_remotes);
@@ -861,7 +861,7 @@ static int get_remote_ref_states(const char *name,
861861

862862
states->remote = remote_get(name);
863863
if (!states->remote)
864-
return error(_("No such remote: %s"), name);
864+
return error(_("No such remote: '%s'"), name);
865865

866866
read_branches();
867867

t/t5505-remote.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ test_expect_success 'remove remote protects local branches' '
145145
test_expect_success 'remove errors out early when deleting non-existent branch' '
146146
(
147147
cd test &&
148-
echo "fatal: No such remote: foo" >expect &&
148+
echo "fatal: No such remote: '\''foo'\''" >expect &&
149149
test_must_fail git remote rm foo 2>actual &&
150150
test_i18ncmp expect actual
151151
)
@@ -173,7 +173,7 @@ test_expect_success 'remove remote with a branch without configured merge' '
173173
test_expect_success 'rename errors out early when deleting non-existent branch' '
174174
(
175175
cd test &&
176-
echo "fatal: No such remote: foo" >expect &&
176+
echo "fatal: No such remote: '\''foo'\''" >expect &&
177177
test_must_fail git remote rename foo bar 2>actual &&
178178
test_i18ncmp expect actual
179179
)

0 commit comments

Comments
 (0)