diff options
author | Tanay Abhra <tanayabh@gmail.com> | 2014-07-18 02:19:00 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-07-21 10:23:44 -0700 |
commit | f93d7c6fa0548e95ca2795d900671a87c1a88ea3 (patch) | |
tree | 1136bcbd0c89c5d40312c5663804530de12a490b /transport.c | |
parent | string-list: add string_list initializer helper function (diff) | |
download | tgif-f93d7c6fa0548e95ca2795d900671a87c1a88ea3.tar.xz |
replace memset with string-list initializers
Using memset and then manually setting values of the string-list
members is not future proof as the internal representation of
string-list may change any time.
Use `string_list_init()` or STRING_LIST_INIT_* macros instead of
memset.
Signed-off-by: Tanay Abhra <tanayabh@gmail.com>
Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'transport.c')
-rw-r--r-- | transport.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/transport.c b/transport.c index 59c9727d8d..d32aaf201c 100644 --- a/transport.c +++ b/transport.c @@ -1188,10 +1188,8 @@ int transport_push(struct transport *transport, if ((flags & (TRANSPORT_RECURSE_SUBMODULES_ON_DEMAND | TRANSPORT_RECURSE_SUBMODULES_CHECK)) && !is_bare_repository()) { struct ref *ref = remote_refs; - struct string_list needs_pushing; + struct string_list needs_pushing = STRING_LIST_INIT_DUP; - memset(&needs_pushing, 0, sizeof(struct string_list)); - needs_pushing.strdup_strings = 1; for (; ref; ref = ref->next) if (!is_null_sha1(ref->new_sha1) && find_unpushed_submodules(ref->new_sha1, |