OSDN Git Service

interpret-trailers: don't duplicate option strings
authorJeff King <peff@peff.net>
Mon, 13 Jun 2016 05:39:20 +0000 (01:39 -0400)
committerJunio C Hamano <gitster@pobox.com>
Mon, 13 Jun 2016 17:33:14 +0000 (10:33 -0700)
There's no need to do so; the argv strings will last until
the end of the program.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/interpret-trailers.c

index 46838d2..b75e953 100644 (file)
@@ -19,7 +19,7 @@ static const char * const git_interpret_trailers_usage[] = {
 int cmd_interpret_trailers(int argc, const char **argv, const char *prefix)
 {
        int trim_empty = 0;
-       struct string_list trailers = STRING_LIST_INIT_DUP;
+       struct string_list trailers = STRING_LIST_INIT_NODUP;
 
        struct option options[] = {
                OPT_BOOL(0, "trim-empty", &trim_empty, N_("trim empty trailers")),