Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
fetch: Future-proof initialization of a refspec on stack
author
Andreas Gruenbacher
<agruen@suse.de>
Fri, 12 Mar 2010 22:27:33 +0000
(23:27 +0100)
committer
Junio C Hamano
<gitster@pobox.com>
Sat, 20 Mar 2010 16:27:17 +0000
(09:27 -0700)
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>
builtin-fetch.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
aac1d7b
)
diff --git
a/builtin-fetch.c
b/builtin-fetch.c
index 0acf80991b57226d44305fd51f2c32544130dc91..8dd1adf84994374713d225395ed7fb074406952b 100644
(file)
--- 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.
*/
* there is no entry in the resulting FETCH_HEAD marked
* for merging.
*/
+ memset(&refspec, 0, sizeof(refspec));
refspec.src = branch->merge[i]->src;
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;
get_fetch_map(remote_refs, &refspec, tail, 1);
for (rm = *old_tail; rm; rm = rm->next)
rm->merge = 1;