diff options
author | Junio C Hamano <gitster@pobox.com> | 2014-07-16 11:48:16 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-07-16 11:48:16 -0700 |
commit | f2c9f21369931c2e4254e49d8f3b3fac5ba8a60b (patch) | |
tree | 987c5234d8db3ad456f9d0820442ec679589f4fe /builtin | |
parent | Eighth batch for 2.1 (diff) | |
parent | Git 2.0.2 (diff) | |
download | tgif-f2c9f21369931c2e4254e49d8f3b3fac5ba8a60b.tar.xz |
Sync with 2.0.2
* maint:
Git 2.0.2
annotate: use argv_array
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/annotate.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/builtin/annotate.c b/builtin/annotate.c index fc43eed36b..da413ae0d1 100644 --- a/builtin/annotate.c +++ b/builtin/annotate.c @@ -5,20 +5,18 @@ */ #include "git-compat-util.h" #include "builtin.h" +#include "argv-array.h" int cmd_annotate(int argc, const char **argv, const char *prefix) { - const char **nargv; + struct argv_array args = ARGV_ARRAY_INIT; int i; - nargv = xmalloc(sizeof(char *) * (argc + 2)); - nargv[0] = "annotate"; - nargv[1] = "-c"; + argv_array_pushl(&args, "annotate", "-c", NULL); for (i = 1; i < argc; i++) { - nargv[i+1] = argv[i]; + argv_array_push(&args, argv[i]); } - nargv[argc + 1] = NULL; - return cmd_blame(argc + 1, nargv, prefix); + return cmd_blame(args.argc, args.argv, prefix); } |