summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2014-07-16 11:11:06 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2014-07-16 11:11:06 -0700
commit9092a9696bee9a5729b7b1741a5de99aecb75552 (patch)
tree269e60cab1739e619e1dd0bae3a4f859ae04d168 /builtin
parentStart preparing for 2.0.2 (diff)
parentMerge branch 'maint-1.8.5' into maint-1.9 (diff)
downloadtgif-9092a9696bee9a5729b7b1741a5de99aecb75552.tar.xz
Merge branch 'maint-1.9' into maint
* maint-1.9: annotate: use argv_array
Diffstat (limited to 'builtin')
-rw-r--r--builtin/annotate.c12
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);
}