Merge branch 'ms/remote-error-message-update'
authorJunio C Hamano <gitster@pobox.com>
Mon, 24 Sep 2018 17:30:52 +0000 (10:30 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 24 Sep 2018 17:30:52 +0000 (10:30 -0700)
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

1  2 
builtin/remote.c
diff --combined builtin/remote.c
index 40c6f8a1bd511f4f498ef534fe8299bda9fa2779,5fd1012faaeceaa0d8db18c3a15310b0d8570043..f7edf7f2cb1f5880e5674f0bf5d41672602e52e4
@@@ -10,7 -10,6 +10,7 @@@
  #include "refspec.h"
  #include "object-store.h"
  #include "argv-array.h"
 +#include "commit-reach.h"
  
  static const char * const builtin_remote_usage[] = {
        N_("git remote [-v | --verbose]"),
@@@ -413,7 -412,7 +413,7 @@@ static int get_push_ref_states(const st
  
                if (is_null_oid(&ref->new_oid)) {
                        info->status = PUSH_STATUS_DELETE;
 -              } else if (!oidcmp(&ref->old_oid, &ref->new_oid))
 +              } else if (oideq(&ref->old_oid, &ref->new_oid))
                        info->status = PUSH_STATUS_UPTODATE;
                else if (is_null_oid(&ref->old_oid))
                        info->status = PUSH_STATUS_CREATE;
@@@ -626,7 -625,7 +626,7 @@@ static int mv(int argc, const char **ar
  
        oldremote = remote_get(rename.old_name);
        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)
                return migrate_file(oldremote);
@@@ -762,7 -761,7 +762,7 @@@ static int rm(int argc, const char **ar
  
        remote = remote_get(argv[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;
        for_each_remote(add_known_remote, &known_remotes);
@@@ -861,7 -860,7 +861,7 @@@ static int get_remote_ref_states(const 
  
        states->remote = remote_get(name);
        if (!states->remote)
-               return error(_("No such remote: %s"), name);
+               return error(_("No such remote: '%s'"), name);
  
        read_branches();