Update to git version v2.29.0, this requires changes for these upstream commits: * dbbcd44fb47347a3fdbee88ea21805b7f4ac0b98 strvec: rename files from argv-array to strvec * 873cd28a8b17ff21908c78c7929a7615f8c94992 argv-array: rename to strvec * d70a9eb611a9d242c1d26847d223b8677609305b strvec: rename struct fields * 6a67c759489e1025665adf78326e9e0d0981bab5 test-lib-functions: restrict test_must_fail usage
Unified · Split
| @@ -14,7 +14,7 @@ htmldir = $(docdir) · 13 unmodified lines | ||
| 14 | 14 | pdfdir = $(docdir) |
| 15 | 15 | mandir = $(prefix)/share/man |
| 16 | 16 | SHA1_HEADER = <openssl/sha.h> |
| 17 | −GIT_VER = 2.28.0 | |
| 17 | +GIT_VER = 2.29.0 | |
| 18 | 18 | GIT_URL = https://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.xz |
| 19 | 19 | INSTALL = install |
| 20 | 20 | COPYTREE = cp -r |
| @@ -14,7 +14,7 @@ · 13 unmodified lines | ||
| 14 | 14 | #include <tag.h> |
| 15 | 15 | #include <diff.h> |
| 16 | 16 | #include <diffcore.h> |
| 17 | −#include <argv-array.h> | |
| 17 | +#include <strvec.h> | |
| 18 | 18 | #include <refs.h> |
| 19 | 19 | #include <revision.h> |
| 20 | 20 | #include <log-tree.h> |
| @@ -1 +1 @@ | ||
| 1 | −Subproject commit 47ae905ffb98cc4d4fd90083da6bc8dab55d9ecc | |
| 1 | +Subproject commit 69986e19ffcfb9af674ae5180689ab7bbf92ed28 | |
| @@ -25,7 +25,7 @@ test_no_home_access () { · 24 unmodified lines | ||
| 25 | 25 | -E CGIT_CONFIG="$PWD/cgitrc" \ |
| 26 | 26 | -E QUERY_STRING="url=$1" \ |
| 27 | 27 | -e access -f -o strace.out cgit && |
| 28 | − test_must_fail grep "$non_existent_path" strace.out | |
| 28 | + ! grep "$non_existent_path" strace.out | |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | test_no_home_access_success() { |
| @@ -10,7 +10,7 @@ · 9 unmodified lines | ||
| 10 | 10 | #include "ui-blame.h" |
| 11 | 11 | #include "html.h" |
| 12 | 12 | #include "ui-shared.h" |
| 13 | −#include "argv-array.h" | |
| 13 | +#include "strvec.h" | |
| 14 | 14 | #include "blame.h" |
| 15 | 15 | |
| 16 | 16 | |
| @@ -104,7 +104,7 @@ static void print_object(const struct object_id *oid, const char *path, · 87 unmodified lines | ||
| 104 | 104 | enum object_type type; |
| 105 | 105 | char *buf; |
| 106 | 106 | unsigned long size; |
| 107 | − struct argv_array rev_argv = ARGV_ARRAY_INIT; | |
| 107 | + struct strvec rev_argv = STRVEC_INIT; | |
| 108 | 108 | struct rev_info revs; |
| 109 | 109 | struct blame_scoreboard sb; |
| 110 | 110 | struct blame_origin *o; |
| @@ -124,11 +124,11 @@ static void print_object(const struct object_id *oid, const char *path, · 13 unmodified lines | ||
| 124 | 124 | return; |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | − argv_array_push(&rev_argv, "blame"); | |
| 128 | − argv_array_push(&rev_argv, rev); | |
| 127 | + strvec_push(&rev_argv, "blame"); | |
| 128 | + strvec_push(&rev_argv, rev); | |
| 129 | 129 | init_revisions(&revs, NULL); |
| 130 | 130 | revs.diffopt.flags.allow_textconv = 1; |
| 131 | − setup_revisions(rev_argv.argc, rev_argv.argv, &revs, NULL); | |
| 131 | + setup_revisions(rev_argv.nr, rev_argv.v, &revs, NULL); | |
| 132 | 132 | init_scoreboard(&sb); |
| 133 | 133 | sb.revs = &revs; |
| 134 | 134 | sb.repo = the_repository; |
| @@ -10,7 +10,7 @@ · 9 unmodified lines | ||
| 10 | 10 | #include "ui-log.h" |
| 11 | 11 | #include "html.h" |
| 12 | 12 | #include "ui-shared.h" |
| 13 | −#include "argv-array.h" | |
| 13 | +#include "strvec.h" | |
| 14 | 14 | |
| 15 | 15 | static int files, add_lines, rem_lines, lines_counted; |
| 16 | 16 | |
| @@ -366,23 +366,23 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern · 349 unmodified lines | ||
| 366 | 366 | { |
| 367 | 367 | struct rev_info rev; |
| 368 | 368 | struct commit *commit; |
| 369 | − struct argv_array rev_argv = ARGV_ARRAY_INIT; | |
| 369 | + struct strvec rev_argv = STRVEC_INIT; | |
| 370 | 370 | int i, columns = commit_graph ? 4 : 3; |
| 371 | 371 | int must_free_tip = 0; |
| 372 | 372 | |
| 373 | 373 | /* rev_argv.argv[0] will be ignored by setup_revisions */ |
| 374 | − argv_array_push(&rev_argv, "log_rev_setup"); | |
| 374 | + strvec_push(&rev_argv, "log_rev_setup"); | |
| 375 | 375 | |
| 376 | 376 | if (!tip) |
| 377 | 377 | tip = ctx.qry.head; |
| 378 | 378 | tip = disambiguate_ref(tip, &must_free_tip); |
| 379 | − argv_array_push(&rev_argv, tip); | |
| 379 | + strvec_push(&rev_argv, tip); | |
| 380 | 380 | |
| 381 | 381 | if (grep && pattern && *pattern) { |
| 382 | 382 | pattern = xstrdup(pattern); |
| 383 | 383 | if (!strcmp(grep, "grep") || !strcmp(grep, "author") || |
| 384 | 384 | !strcmp(grep, "committer")) { |
| 385 | − argv_array_pushf(&rev_argv, "--%s=%s", grep, pattern); | |
| 385 | + strvec_pushf(&rev_argv, "--%s=%s", grep, pattern); | |
| 386 | 386 | } else if (!strcmp(grep, "range")) { |
| 387 | 387 | char *arg; |
| 388 | 388 | /* Split the pattern at whitespace and add each token |
| @@ -390,14 +390,14 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern · 1 unmodified line | ||
| 390 | 390 | * rev-list options. Also, replace the previously |
| 391 | 391 | * pushed tip (it's no longer relevant). |
| 392 | 392 | */ |
| 393 | − argv_array_pop(&rev_argv); | |
| 393 | + strvec_pop(&rev_argv); | |
| 394 | 394 | while ((arg = next_token(&pattern))) { |
| 395 | 395 | if (*arg == '-') { |
| 396 | 396 | fprintf(stderr, "Bad range expr: %s\n", |
| 397 | 397 | arg); |
| 398 | 398 | break; |
| 399 | 399 | } |
| 400 | − argv_array_push(&rev_argv, arg); | |
| 400 | + strvec_push(&rev_argv, arg); | |
| 401 | 401 | } |
| 402 | 402 | } |
| 403 | 403 | } |
| @@ -412,22 +412,22 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern · 8 unmodified lines | ||
| 412 | 412 | } |
| 413 | 413 | |
| 414 | 414 | if (commit_graph && !ctx.qry.follow) { |
| 415 | − argv_array_push(&rev_argv, "--graph"); | |
| 416 | − argv_array_push(&rev_argv, "--color"); | |
| 415 | + strvec_push(&rev_argv, "--graph"); | |
| 416 | + strvec_push(&rev_argv, "--color"); | |
| 417 | 417 | graph_set_column_colors(column_colors_html, |
| 418 | 418 | COLUMN_COLORS_HTML_MAX); |
| 419 | 419 | } |
| 420 | 420 | |
| 421 | 421 | if (commit_sort == 1) |
| 422 | − argv_array_push(&rev_argv, "--date-order"); | |
| 422 | + strvec_push(&rev_argv, "--date-order"); | |
| 423 | 423 | else if (commit_sort == 2) |
| 424 | − argv_array_push(&rev_argv, "--topo-order"); | |
| 424 | + strvec_push(&rev_argv, "--topo-order"); | |
| 425 | 425 | |
| 426 | 426 | if (path && ctx.qry.follow) |
| 427 | − argv_array_push(&rev_argv, "--follow"); | |
| 428 | − argv_array_push(&rev_argv, "--"); | |
| 427 | + strvec_push(&rev_argv, "--follow"); | |
| 428 | + strvec_push(&rev_argv, "--"); | |
| 429 | 429 | if (path) |
| 430 | − argv_array_push(&rev_argv, path); | |
| 430 | + strvec_push(&rev_argv, path); | |
| 431 | 431 | |
| 432 | 432 | init_revisions(&rev, NULL); |
| 433 | 433 | rev.abbrev = DEFAULT_ABBREV; |
| @@ -436,7 +436,7 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern · 2 unmodified lines | ||
| 436 | 436 | rev.show_root_diff = 0; |
| 437 | 437 | rev.ignore_missing = 1; |
| 438 | 438 | rev.simplify_history = 1; |
| 439 | − setup_revisions(rev_argv.argc, rev_argv.argv, &rev, NULL); | |
| 439 | + setup_revisions(rev_argv.nr, rev_argv.v, &rev, NULL); | |
| 440 | 440 | load_ref_decorations(NULL, DECORATE_FULL_REFS); |
| 441 | 441 | rev.show_decorations = 1; |
| 442 | 442 | rev.grep_filter.ignore_case = 1; |
| @@ -13,32 +13,32 @@ · 12 unmodified lines | ||
| 13 | 13 | |
| 14 | 14 | static int write_archive_type(const char *format, const char *hex, const char *prefix) |
| 15 | 15 | { |
| 16 | − struct argv_array argv = ARGV_ARRAY_INIT; | |
| 16 | + struct strvec argv = STRVEC_INIT; | |
| 17 | 17 | const char **nargv; |
| 18 | 18 | int result; |
| 19 | − argv_array_push(&argv, "snapshot"); | |
| 20 | − argv_array_push(&argv, format); | |
| 19 | + strvec_push(&argv, "snapshot"); | |
| 20 | + strvec_push(&argv, format); | |
| 21 | 21 | if (prefix) { |
| 22 | 22 | struct strbuf buf = STRBUF_INIT; |
| 23 | 23 | strbuf_addstr(&buf, prefix); |
| 24 | 24 | strbuf_addch(&buf, '/'); |
| 25 | − argv_array_push(&argv, "--prefix"); | |
| 26 | − argv_array_push(&argv, buf.buf); | |
| 25 | + strvec_push(&argv, "--prefix"); | |
| 26 | + strvec_push(&argv, buf.buf); | |
| 27 | 27 | strbuf_release(&buf); |
| 28 | 28 | } |
| 29 | − argv_array_push(&argv, hex); | |
| 29 | + strvec_push(&argv, hex); | |
| 30 | 30 | /* |
| 31 | 31 | * Now we need to copy the pointers to arguments into a new |
| 32 | 32 | * structure because write_archive will rearrange its arguments |
| 33 | 33 | * which may result in duplicated/missing entries causing leaks |
| 34 | − * or double-frees in argv_array_clear. | |
| 34 | + * or double-frees in strvec_clear. | |
| 35 | 35 | */ |
| 36 | − nargv = xmalloc(sizeof(char *) * (argv.argc + 1)); | |
| 37 | − /* argv_array guarantees a trailing NULL entry. */ | |
| 38 | − memcpy(nargv, argv.argv, sizeof(char *) * (argv.argc + 1)); | |
| 36 | + nargv = xmalloc(sizeof(char *) * (argv.nr + 1)); | |
| 37 | + /* strvec guarantees a trailing NULL entry. */ | |
| 38 | + memcpy(nargv, argv.v, sizeof(char *) * (argv.nr + 1)); | |
| 39 | 39 | |
| 40 | − result = write_archive(argv.argc, nargv, NULL, the_repository, NULL, 0); | |
| 41 | − argv_array_clear(&argv); | |
| 40 | + result = write_archive(argv.nr, nargv, NULL, the_repository, NULL, 0); | |
| 41 | + strvec_clear(&argv); | |
| 42 | 42 | free(nargv); |
| 43 | 43 | return result; |
| 44 | 44 | } |