Skip to content

Commit 8da61a2

Browse files
Andreas Gruenbachergitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent aac1d7b commit 8da61a2

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

builtin-fetch.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,8 @@ static void add_merge_config(struct ref **head,
104104
* there is no entry in the resulting FETCH_HEAD marked
105105
* for merging.
106106
*/
107+
memset(&refspec, 0, sizeof(refspec));
107108
refspec.src = branch->merge[i]->src;
108-
refspec.dst = NULL;
109-
refspec.pattern = 0;
110-
refspec.force = 0;
111109
get_fetch_map(remote_refs, &refspec, tail, 1);
112110
for (rm = *old_tail; rm; rm = rm->next)
113111
rm->merge = 1;

0 commit comments

Comments
 (0)