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 <agruen@suse.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Andreas Gruenbacher committed
Mar 12, 2010 at 23:27 UTC
8da61a2ab48175526390233c8bcedf63a3cdb6c4
1 file changed
+1
-3
builtin-fetch.c
+1
-3
@@ -104,10 +104,8 @@ static void add_merge_config(struct ref **head,
104
* there is no entry in the resulting FETCH_HEAD marked
105
* for merging.
106
*/
107
+ memset(&refspec, 0, sizeof(refspec));
108
refspec.src = branch->merge[i]->src;
108
- refspec.dst = NULL;
109
- refspec.pattern = 0;
110
- refspec.force = 0;
109
get_fetch_map(remote_refs, &refspec, tail, 1);
110
for (rm = *old_tail; rm; rm = rm->next)
111
rm->merge = 1;