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;
}
struct option options[] = {
OPT_GROUP("update specific options"),
OPT_BOOLEAN('p', "prune", &prune,
- "prune remotes after fecthing"),
+ "prune remotes after fetching"),
OPT_END()
};
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"))