static int add(int argc, const char **argv)
{
int fetch = 0, mirror = 0, fetch_tags = TAGS_DEFAULT;
static int add(int argc, const char **argv)
{
int fetch = 0, mirror = 0, fetch_tags = TAGS_DEFAULT;
const char *master = NULL;
struct remote *remote;
struct strbuf buf = STRBUF_INIT, buf2 = STRBUF_INIT;
const char *master = NULL;
struct remote *remote;
struct strbuf buf = STRBUF_INIT, buf2 = STRBUF_INIT;
for (i = 0; i < track.nr; i++) {
if (add_branch(buf.buf, track.items[i].string,
name, mirror, &buf2))
for (i = 0; i < track.nr; i++) {
if (add_branch(buf.buf, track.items[i].string,
name, mirror, &buf2))
value = abbrev_branch(space + 1);
space = strchr(value, ' ');
}
value = abbrev_branch(space + 1);
space = strchr(value, ' ');
}
for (ref = fetch_map; ref; ref = ref->next) {
unsigned char sha1[20];
if (!ref->peer_ref || read_ref(ref->peer_ref->name, sha1))
for (ref = fetch_map; ref; ref = ref->next) {
unsigned char sha1[20];
if (!ref->peer_ref || read_ref(ref->peer_ref->name, sha1))
}
stale_refs = get_stale_heads(states->remote, fetch_map);
for (ref = stale_refs; ref; ref = ref->next) {
struct string_list_item *item =
}
stale_refs = get_stale_heads(states->remote, fetch_map);
for (ref = stale_refs; ref; ref = ref->next) {
struct string_list_item *item =
item->util = xcalloc(sizeof(struct push_info), 1);
info = item->util;
info->forced = ref->force;
item->util = xcalloc(sizeof(struct push_info), 1);
info = item->util;
info->forced = ref->force;
info = item->util = xcalloc(sizeof(struct push_info), 1);
info->status = PUSH_STATUS_NOTQUERIED;
info->dest = xstrdup(item->string);
info = item->util = xcalloc(sizeof(struct push_info), 1);
info->status = PUSH_STATUS_NOTQUERIED;
info->dest = xstrdup(item->string);
info = item->util = xcalloc(sizeof(struct push_info), 1);
info->forced = spec->force;
info = item->util = xcalloc(sizeof(struct push_info), 1);
info->forced = spec->force;
matches = guess_remote_head(find_ref_by_name(remote_refs, "HEAD"),
fetch_map, 1);
for (ref = matches; ref; ref = ref->next)
matches = guess_remote_head(find_ref_by_name(remote_refs, "HEAD"),
fetch_map, 1);
for (ref = matches; ref; ref = ref->next)
if (prefixcmp(refname, "refs/remotes")) {
/* advise user how to delete local branches */
if (!prefixcmp(refname, "refs/heads/"))
if (prefixcmp(refname, "refs/remotes")) {
/* advise user how to delete local branches */
if (!prefixcmp(refname, "refs/heads/"))
if (flags & REF_ISSYMREF)
return unlink(git_path("%s", refname));
if (flags & REF_ISSYMREF)
return unlink(git_path("%s", refname));
item->util = xmalloc(20);
hashcpy(item->util, sha1);
item->util = xmalloc(20);
hashcpy(item->util, sha1);
strbuf_addf(&buf, "refs/remotes/%s", rename->old);
if (!prefixcmp(refname, buf.buf)) {
strbuf_addf(&buf, "refs/remotes/%s", rename->old);
if (!prefixcmp(refname, buf.buf)) {
symref = resolve_ref(refname, orig_sha1, 1, &flag);
if (flag & REF_ISSYMREF)
item->util = xstrdup(symref);
symref = resolve_ref(refname, orig_sha1, 1, &flag);
if (flag & REF_ISSYMREF)
item->util = xstrdup(symref);
};
struct remote *oldremote, *newremote;
struct strbuf buf = STRBUF_INIT, buf2 = STRBUF_INIT, buf3 = STRBUF_INIT;
};
struct remote *oldremote, *newremote;
struct strbuf buf = STRBUF_INIT, buf2 = STRBUF_INIT, buf3 = STRBUF_INIT;
struct remote *remote;
struct strbuf buf = STRBUF_INIT;
struct known_remotes known_remotes = { NULL, NULL };
struct remote *remote;
struct strbuf buf = STRBUF_INIT;
struct known_remotes known_remotes = { NULL, NULL };
- struct string_list branches = { NULL, 0, 0, 1 };
- struct string_list skipped = { NULL, 0, 0, 1 };
+ struct string_list branches = STRING_LIST_INIT_DUP;
+ struct string_list skipped = STRING_LIST_INIT_DUP;
memset(&refspec, 0, sizeof(refspec));
refspec.dst = (char *)refname;
if (!remote_find_tracking(states->remote, &refspec))
memset(&refspec, 0, sizeof(refspec));
refspec.dst = (char *)refname;
if (!remote_find_tracking(states->remote, &refspec))
struct show_info info;
argc = parse_options(argc, argv, NULL, options, builtin_remote_show_usage,
struct show_info info;
argc = parse_options(argc, argv, NULL, options, builtin_remote_show_usage,
- for_each_string_list(add_remote_to_show_info, &states.new, &info);
- for_each_string_list(add_remote_to_show_info, &states.tracked, &info);
- for_each_string_list(add_remote_to_show_info, &states.stale, &info);
+ for_each_string_list(&states.new, add_remote_to_show_info, &info);
+ for_each_string_list(&states.tracked, add_remote_to_show_info, &info);
+ for_each_string_list(&states.stale, add_remote_to_show_info, &info);
if (info.list->nr)
printf(" Remote branch%s:%s\n",
info.list->nr > 1 ? "es" : "",
no_query ? " (status not queried)" : "");
if (info.list->nr)
printf(" Remote branch%s:%s\n",
info.list->nr > 1 ? "es" : "",
no_query ? " (status not queried)" : "");
if (info.list->nr)
printf(" Local branch%s configured for 'git pull':\n",
info.list->nr > 1 ? "es" : "");
if (info.list->nr)
printf(" Local branch%s configured for 'git pull':\n",
info.list->nr > 1 ? "es" : "");
qsort(info.list->items, info.list->nr,
sizeof(*info.list->items), cmp_string_with_push);
if (info.list->nr)
printf(" Local ref%s configured for 'git push'%s:\n",
info.list->nr > 1 ? "s" : "",
no_query ? " (status not queried)" : "");
qsort(info.list->items, info.list->nr,
sizeof(*info.list->items), cmp_string_with_push);
if (info.list->nr)
printf(" Local ref%s configured for 'git push'%s:\n",
info.list->nr > 1 ? "s" : "",
no_query ? " (status not queried)" : "");
string_list_clear(info.list, 0);
free_remote_ref_states(&states);
string_list_clear(info.list, 0);
free_remote_ref_states(&states);
if (remote->url_nr > 0) {
strbuf_addf(&url_buf, "%s (fetch)", remote->url[0]);
if (remote->url_nr > 0) {
strbuf_addf(&url_buf, "%s (fetch)", remote->url[0]);
for (i = 0; i < url_nr; i++)
{
strbuf_addf(&url_buf, "%s (push)", url[i]);
for (i = 0; i < url_nr; i++)
{
strbuf_addf(&url_buf, "%s (push)", url[i]);