diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-07-06 13:38:07 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-07-06 13:38:08 -0700 |
commit | b8b6365a8a214f2427f2cf9334fd43ace0be619c (patch) | |
tree | 983ce79cdb05e7d8612b3240699b9cbf20370a30 /builtin/blame.c | |
parent | 7e58b8166e6ac191739cf9001e73b2157f3aead5 (diff) | |
parent | 2721ce21e439ee0726dc69073acd7e0d2b2407b3 (diff) | |
download | git-b8b6365a8a214f2427f2cf9334fd43ace0be619c.tar.gz |
Merge branch 'jk/string-list-static-init'
Instead of taking advantage of a struct string_list that is
allocated with all NULs happens to be STRING_LIST_INIT_NODUP kind,
initialize them explicitly as such, to document their behaviour
better.
* jk/string-list-static-init:
use string_list initializer consistently
blame,shortlog: don't make local option variables static
interpret-trailers: don't duplicate option strings
parse_opt_string_list: stop allocating new strings
Diffstat (limited to 'builtin/blame.c')
-rw-r--r-- | builtin/blame.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/builtin/blame.c b/builtin/blame.c index e5deb9c67f..1e214bd4ec 100644 --- a/builtin/blame.c +++ b/builtin/blame.c @@ -56,7 +56,7 @@ static int show_progress; static struct date_mode blame_date_mode = { DATE_ISO8601 }; static size_t blame_date_width; -static struct string_list mailmap; +static struct string_list mailmap = STRING_LIST_INIT_NODUP; #ifndef DEBUG #define DEBUG 0 @@ -2520,12 +2520,12 @@ int cmd_blame(int argc, const char **argv, const char *prefix) enum object_type type; struct commit *final_commit = NULL; - static struct string_list range_list; - static int output_option = 0, opt = 0; - static int show_stats = 0; - static const char *revs_file = NULL; - static const char *contents_from = NULL; - static const struct option options[] = { + struct string_list range_list = STRING_LIST_INIT_NODUP; + int output_option = 0, opt = 0; + int show_stats = 0; + const char *revs_file = NULL; + const char *contents_from = NULL; + const struct option options[] = { OPT_BOOL(0, "incremental", &incremental, N_("Show blame entries as we find them, incrementally")), OPT_BOOL('b', NULL, &blank_boundary, N_("Show blank SHA-1 for boundary commits (Default: off)")), OPT_BOOL(0, "root", &show_root, N_("Do not treat root commits as boundaries (Default: off)")), |