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 /builtin | |
parent | 3ed3f5fe85ac3fa7f94ccaab59408a20db8c7a41 (diff) | |
download | git-f93d7c6fa0548e95ca2795d900671a87c1a88ea3.tar.gz |
replace memset with string-list initializersta/string-list-init
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 'builtin')
-rw-r--r-- | builtin/commit.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/builtin/commit.c b/builtin/commit.c index 461c3b1cad..023df406f8 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -423,8 +423,7 @@ static char *prepare_index(int argc, const char **argv, const char *prefix, die(_("cannot do a partial commit during a cherry-pick.")); } - memset(&partial, 0, sizeof(partial)); - partial.strdup_strings = 1; + string_list_init(&partial, 1); if (list_paths(&partial, !current_head ? NULL : "HEAD", prefix, &pathspec)) exit(1); |