X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=builtin%2Ffetch.c;h=957be9f9269c657fb094b1b3daa4f309c1324ae0;hb=4bb6644d03f6932b94c24c3825e28865f493b692;hp=2bb75c130526d506b066c890cf165302dbb3c14d;hpb=60dafdd37d7df358b6ff67b317dbe738b50ea6d6;p=git.git diff --git a/builtin/fetch.c b/builtin/fetch.c index 2bb75c130..957be9f92 100644 --- a/builtin/fetch.c +++ b/builtin/fetch.c @@ -107,10 +107,8 @@ static void add_merge_config(struct ref **head, * there is no entry in the resulting FETCH_HEAD marked * for merging. */ + memset(&refspec, 0, sizeof(refspec)); refspec.src = branch->merge[i]->src; - refspec.dst = NULL; - refspec.pattern = 0; - refspec.force = 0; get_fetch_map(remote_refs, &refspec, tail, 1); for (rm = *old_tail; rm; rm = rm->next) rm->merge = 1; @@ -391,9 +389,10 @@ static int store_updated_refs(const char *raw_url, const char *remote_name, fputc(url[i], fp); fputc('\n', fp); - if (ref) + if (ref) { rc |= update_local_ref(ref, what, note); - else + free(ref); + } else sprintf(note, "* %-*s %-*s -> FETCH_HEAD", TRANSPORT_SUMMARY_WIDTH, *kind ? kind : "branch", REFCOL_WIDTH, *what ? what : "HEAD"); @@ -590,7 +589,7 @@ static void find_non_local_tags(struct transport *transport, * to fetch then we can mark the ref entry in the list * as one to ignore by setting util to NULL. */ - if (!strcmp(ref->name + strlen(ref->name) - 3, "^{}")) { + if (!suffixcmp(ref->name, "^{}")) { if (item && !has_sha1_file(ref->old_sha1) && !will_fetch(head, ref->old_sha1) && !has_sha1_file(item->util) &&