diff options
author | Junio C Hamano <gitster@pobox.com> | 2014-07-16 11:10:30 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-07-16 11:10:30 -0700 |
commit | d22acacf810a92d5634099a7db0367ce5b6fdcef (patch) | |
tree | 9536fe05bcb4067f19cd8020bc5bc04c468df7b7 | |
parent | Git 1.9.4 (diff) | |
parent | annotate: use argv_array (diff) | |
download | tgif-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
-rw-r--r-- | builtin/annotate.c | 12 | ||||
-rw-r--r-- | builtin/clean.c | 2 | ||||
-rw-r--r-- | pretty.c | 2 | ||||
-rwxr-xr-x | t/t7300-clean.sh | 4 |
4 files changed, 9 insertions, 11 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 @@ -274,7 +274,7 @@ static void add_rfc822_quoted(struct strbuf *out, const char *s, int len) enum rfc2047_type { RFC2047_SUBJECT, - RFC2047_ADDRESS, + RFC2047_ADDRESS }; static int is_rfc2047_special(char ch, enum rfc2047_type type) diff --git a/t/t7300-clean.sh b/t/t7300-clean.sh index 74de814aec..04118ad75b 100755 --- a/t/t7300-clean.sh +++ b/t/t7300-clean.sh @@ -426,10 +426,10 @@ test_expect_success SANITY 'removal failure' ' mkdir foo && touch foo/bar && + test_when_finished "chmod 755 foo" && (exec <foo/bar && chmod 0 foo && - test_must_fail git clean -f -d && - chmod 755 foo) + test_must_fail git clean -f -d) ' test_expect_success 'nested git work tree' ' |