t3901: Use ISO8859-1 instead of ISO-8859-1 for backward compatibility
[gitweb.git] / builtin-remote.c
index 51df99ba930c47c1163cdc3399f27d2a69c29a93..71abf68404f5b260ba96208717d89e50e778dd36 100644 (file)
@@ -525,8 +525,8 @@ static int migrate_file(struct remote *remote)
                path = git_path("remotes/%s", remote->name);
        else if (remote->origin == REMOTE_BRANCHES)
                path = git_path("branches/%s", remote->name);
-       if (path && unlink(path))
-               warning("failed to remove '%s'", path);
+       if (path)
+               unlink_or_warn(path);
        return 0;
 }
 
@@ -1216,7 +1216,7 @@ static int update(int argc, const char **argv)
        struct option options[] = {
                OPT_GROUP("update specific options"),
                OPT_BOOLEAN('p', "prune", &prune,
-                           "prune remotes after fecthing"),
+                           "prune remotes after fetching"),
                OPT_END()
        };
 
@@ -1232,8 +1232,14 @@ static int update(int argc, const char **argv)
                int groups_found = 0;
                remote_group.name = argv[i];
                result = git_config(get_remote_group, &groups_found);
-               if (!groups_found && (i != 1 || strcmp(argv[1], "default")))
-                       die("No such remote group: '%s'", argv[i]);
+               if (!groups_found && (i != 1 || strcmp(argv[1], "default"))) {
+                       struct remote *remote;
+                       if (!remote_is_configured(argv[i]))
+                               die("No such remote or remote group: %s",
+                                   argv[i]);
+                       remote = remote_get(argv[i]);
+                       string_list_append(remote->name, remote_group.list);
+               }
        }
 
        if (!result && !list.nr  && argc == 2 && !strcmp(argv[1], "default"))