From: Andreas Gruenbacher Date: Fri, 12 Mar 2010 22:27:33 +0000 (+0100) Subject: fetch: Future-proof initialization of a refspec on stack X-Git-Tag: v1.7.0.3~5 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=8da61a2ab48175526390233c8bcedf63a3cdb6c4;p=git.git fetch: Future-proof initialization of a refspec on stack The open-coded version to initialize each and every member will break when a new member is added to the structure. Signed-off-by: Andreas Gruenbacher Signed-off-by: Junio C Hamano --- diff --git a/builtin-fetch.c b/builtin-fetch.c index 0acf80991..8dd1adf84 100644 --- a/builtin-fetch.c +++ b/builtin-fetch.c @@ -104,10 +104,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;