summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2014-07-16 11:10:30 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2014-07-16 11:10:30 -0700
commitd22acacf810a92d5634099a7db0367ce5b6fdcef (patch)
tree9536fe05bcb4067f19cd8020bc5bc04c468df7b7 /builtin
parentGit 1.9.4 (diff)
parentannotate: use argv_array (diff)
downloadtgif-d22acacf810a92d5634099a7db0367ce5b6fdcef.tar.xz
Merge branch 'maint-1.8.5' into maint-1.9
* maint-1.8.5: annotate: use argv_array t7300: repair filesystem permissions with test_when_finished enums: remove trailing ',' after last item in enum
Diffstat (limited to 'builtin')
-rw-r--r--builtin/annotate.c12
-rw-r--r--builtin/clean.c2
2 files changed, 6 insertions, 8 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);
}
diff --git a/builtin/clean.c b/builtin/clean.c
index 977a068f11..8926ca851c 100644
--- a/builtin/clean.c
+++ b/builtin/clean.c
@@ -48,7 +48,7 @@ enum color_clean {
CLEAN_COLOR_PROMPT = 2,
CLEAN_COLOR_HEADER = 3,
CLEAN_COLOR_HELP = 4,
- CLEAN_COLOR_ERROR = 5,
+ CLEAN_COLOR_ERROR = 5
};
#define MENU_OPTS_SINGLETON 01