about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorChristian Hesse2020-10-06 16:32:08 +0200
committerChristian Hesse2020-10-19 20:27:28 +0200
commit629659d2cffbf059374fc53e6400ff0bebe1ddde (patch)
tree5447658c87e9aa4331e36ace5ebe295d9ed2952e
parentgit: update to v2.28.0 (diff)
downloadcgit-629659d2cffbf059374fc53e6400ff0bebe1ddde.tar.gz
cgit-629659d2cffbf059374fc53e6400ff0bebe1ddde.zip
git: update to v2.29.0
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

Signed-off-by: Christian Hesse <mail@eworm.de>
-rw-r--r--Makefile2
-rw-r--r--cgit.h2
m---------git0
-rwxr-xr-xtests/t0109-gitconfig.sh2
-rw-r--r--ui-blame.c10
-rw-r--r--ui-log.c30
-rw-r--r--ui-snapshot.c24
7 files changed, 35 insertions, 35 deletions
diff --git a/Makefile b/Makefile index 84822f0..c947b63 100644 --- a/Makefile +++ b/Makefile
@@ -14,7 +14,7 @@ htmldir = $(docdir)
14pdfdir = $(docdir) 14pdfdir = $(docdir)
15mandir = $(prefix)/share/man 15mandir = $(prefix)/share/man
16SHA1_HEADER = <openssl/sha.h> 16SHA1_HEADER = <openssl/sha.h>
17GIT_VER = 2.28.0 17GIT_VER = 2.29.0
18GIT_URL = https://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.xz 18GIT_URL = https://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.xz
19INSTALL = install 19INSTALL = install
20COPYTREE = cp -r 20COPYTREE = cp -r
diff --git a/cgit.h b/cgit.h index 7ec46b4..f5db364 100644 --- a/cgit.h +++ b/cgit.h
@@ -14,7 +14,7 @@
14#include <tag.h> 14#include <tag.h>
15#include <diff.h> 15#include <diff.h>
16#include <diffcore.h> 16#include <diffcore.h>
17#include <argv-array.h> 17#include <strvec.h>
18#include <refs.h> 18#include <refs.h>
19#include <revision.h> 19#include <revision.h>
20#include <log-tree.h> 20#include <log-tree.h>
diff --git a/git b/git
Subproject 47ae905ffb98cc4d4fd90083da6bc8dab55d9ec Subproject 69986e19ffcfb9af674ae5180689ab7bbf92ed2
diff --git a/tests/t0109-gitconfig.sh b/tests/t0109-gitconfig.sh index 8cee75c..189ef28 100755 --- a/tests/t0109-gitconfig.sh +++ b/tests/t0109-gitconfig.sh
@@ -25,7 +25,7 @@ test_no_home_access () {
25 -E CGIT_CONFIG="$PWD/cgitrc" \ 25 -E CGIT_CONFIG="$PWD/cgitrc" \
26 -E QUERY_STRING="url=$1" \ 26 -E QUERY_STRING="url=$1" \
27 -e access -f -o strace.out cgit && 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
31test_no_home_access_success() { 31test_no_home_access_success() {
diff --git a/ui-blame.c b/ui-blame.c index f28eea0..c3662bb 100644 --- a/ui-blame.c +++ b/ui-blame.c
@@ -10,7 +10,7 @@
10#include "ui-blame.h" 10#include "ui-blame.h"
11#include "html.h" 11#include "html.h"
12#include "ui-shared.h" 12#include "ui-shared.h"
13#include "argv-array.h" 13#include "strvec.h"
14#include "blame.h" 14#include "blame.h"
15 15
16 16
@@ -104,7 +104,7 @@ static void print_object(const struct object_id *oid, const char *path,
104 enum object_type type; 104 enum object_type type;
105 char *buf; 105 char *buf;
106 unsigned long size; 106 unsigned long size;
107 struct argv_array rev_argv = ARGV_ARRAY_INIT; 107 struct strvec rev_argv = STRVEC_INIT;
108 struct rev_info revs; 108 struct rev_info revs;
109 struct blame_scoreboard sb; 109 struct blame_scoreboard sb;
110 struct blame_origin *o; 110 struct blame_origin *o;
@@ -124,11 +124,11 @@ static void print_object(const struct object_id *oid, const char *path,
124 return; 124 return;
125 } 125 }
126 126
127 argv_array_push(&rev_argv, "blame"); 127 strvec_push(&rev_argv, "blame");
128 argv_array_push(&rev_argv, rev); 128 strvec_push(&rev_argv, rev);
129 init_revisions(&revs, NULL); 129 init_revisions(&revs, NULL);
130 revs.diffopt.flags.allow_textconv = 1; 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 init_scoreboard(&sb); 132 init_scoreboard(&sb);
133 sb.revs = &revs; 133 sb.revs = &revs;
134 sb.repo = the_repository; 134 sb.repo = the_repository;
diff --git a/ui-log.c b/ui-log.c index 2939c01..fd07409 100644 --- a/ui-log.c +++ b/ui-log.c
@@ -10,7 +10,7 @@
10#include "ui-log.h" 10#include "ui-log.h"
11#include "html.h" 11#include "html.h"
12#include "ui-shared.h" 12#include "ui-shared.h"
13#include "argv-array.h" 13#include "strvec.h"
14 14
15static int files, add_lines, rem_lines, lines_counted; 15static 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
366{ 366{
367 struct rev_info rev; 367 struct rev_info rev;
368 struct commit *commit; 368 struct commit *commit;
369 struct argv_array rev_argv = ARGV_ARRAY_INIT; 369 struct strvec rev_argv = STRVEC_INIT;
370 int i, columns = commit_graph ? 4 : 3; 370 int i, columns = commit_graph ? 4 : 3;
371 int must_free_tip = 0; 371 int must_free_tip = 0;
372 372
373 /* rev_argv.argv[0] will be ignored by setup_revisions */ 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 if (!tip) 376 if (!tip)
377 tip = ctx.qry.head; 377 tip = ctx.qry.head;
378 tip = disambiguate_ref(tip, &must_free_tip); 378 tip = disambiguate_ref(tip, &must_free_tip);
379 argv_array_push(&rev_argv, tip); 379 strvec_push(&rev_argv, tip);
380 380
381 if (grep && pattern && *pattern) { 381 if (grep && pattern && *pattern) {
382 pattern = xstrdup(pattern); 382 pattern = xstrdup(pattern);
383 if (!strcmp(grep, "grep") || !strcmp(grep, "author") || 383 if (!strcmp(grep, "grep") || !strcmp(grep, "author") ||
384 !strcmp(grep, "committer")) { 384 !strcmp(grep, "committer")) {
385 argv_array_pushf(&rev_argv, "--%s=%s", grep, pattern); 385 strvec_pushf(&rev_argv, "--%s=%s", grep, pattern);
386 } else if (!strcmp(grep, "range")) { 386 } else if (!strcmp(grep, "range")) {
387 char *arg; 387 char *arg;
388 /* Split the pattern at whitespace and add each token 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
390 * rev-list options. Also, replace the previously 390 * rev-list options. Also, replace the previously
391 * pushed tip (it's no longer relevant). 391 * pushed tip (it's no longer relevant).
392 */ 392 */
393 argv_array_pop(&rev_argv); 393 strvec_pop(&rev_argv);
394 while ((arg = next_token(&pattern))) { 394 while ((arg = next_token(&pattern))) {
395 if (*arg == '-') { 395 if (*arg == '-') {
396 fprintf(stderr, "Bad range expr: %s\n", 396 fprintf(stderr, "Bad range expr: %s\n",
397 arg); 397 arg);
398 break; 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
412 } 412 }
413 413
414 if (commit_graph && !ctx.qry.follow) { 414 if (commit_graph && !ctx.qry.follow) {
415 argv_array_push(&rev_argv, "--graph"); 415 strvec_push(&rev_argv, "--graph");
416 argv_array_push(&rev_argv, "--color"); 416 strvec_push(&rev_argv, "--color");
417 graph_set_column_colors(column_colors_html, 417 graph_set_column_colors(column_colors_html,
418 COLUMN_COLORS_HTML_MAX); 418 COLUMN_COLORS_HTML_MAX);
419 } 419 }
420 420
421 if (commit_sort == 1) 421 if (commit_sort == 1)
422 argv_array_push(&rev_argv, "--date-order"); 422 strvec_push(&rev_argv, "--date-order");
423 else if (commit_sort == 2) 423 else if (commit_sort == 2)
424 argv_array_push(&rev_argv, "--topo-order"); 424 strvec_push(&rev_argv, "--topo-order");
425 425
426 if (path && ctx.qry.follow) 426 if (path && ctx.qry.follow)
427 argv_array_push(&rev_argv, "--follow"); 427 strvec_push(&rev_argv, "--follow");
428 argv_array_push(&rev_argv, "--"); 428 strvec_push(&rev_argv, "--");
429 if (path) 429 if (path)
430 argv_array_push(&rev_argv, path); 430 strvec_push(&rev_argv, path);
431 431
432 init_revisions(&rev, NULL); 432 init_revisions(&rev, NULL);
433 rev.abbrev = DEFAULT_ABBREV; 433 rev.abbrev = DEFAULT_ABBREV;
@@ -436,7 +436,7 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern
436 rev.show_root_diff = 0; 436 rev.show_root_diff = 0;
437 rev.ignore_missing = 1; 437 rev.ignore_missing = 1;
438 rev.simplify_history = 1; 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 load_ref_decorations(NULL, DECORATE_FULL_REFS); 440 load_ref_decorations(NULL, DECORATE_FULL_REFS);
441 rev.show_decorations = 1; 441 rev.show_decorations = 1;
442 rev.grep_filter.ignore_case = 1; 442 rev.grep_filter.ignore_case = 1;
diff --git a/ui-snapshot.c b/ui-snapshot.c index 556d3ed..18361a6 100644 --- a/ui-snapshot.c +++ b/ui-snapshot.c
@@ -13,32 +13,32 @@
13 13
14static int write_archive_type(const char *format, const char *hex, const char *prefix) 14static 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 const char **nargv; 17 const char **nargv;
18 int result; 18 int result;
19 argv_array_push(&argv, "snapshot"); 19 strvec_push(&argv, "snapshot");
20 argv_array_push(&argv, format); 20 strvec_push(&argv, format);
21 if (prefix) { 21 if (prefix) {
22 struct strbuf buf = STRBUF_INIT; 22 struct strbuf buf = STRBUF_INIT;
23 strbuf_addstr(&buf, prefix); 23 strbuf_addstr(&buf, prefix);
24 strbuf_addch(&buf, '/'); 24 strbuf_addch(&buf, '/');
25 argv_array_push(&argv, "--prefix"); 25 strvec_push(&argv, "--prefix");
26 argv_array_push(&argv, buf.buf); 26 strvec_push(&argv, buf.buf);
27 strbuf_release(&buf); 27 strbuf_release(&buf);
28 } 28 }
29 argv_array_push(&argv, hex); 29 strvec_push(&argv, hex);
30 /* 30 /*
31 * Now we need to copy the pointers to arguments into a new 31 * Now we need to copy the pointers to arguments into a new
32 * structure because write_archive will rearrange its arguments 32 * structure because write_archive will rearrange its arguments
33 * which may result in duplicated/missing entries causing leaks 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)); 36 nargv = xmalloc(sizeof(char *) * (argv.nr + 1));
37 /* argv_array guarantees a trailing NULL entry. */ 37 /* strvec guarantees a trailing NULL entry. */
38 memcpy(nargv, argv.argv, sizeof(char *) * (argv.argc + 1)); 38 memcpy(nargv, argv.v, sizeof(char *) * (argv.nr + 1));
39 39
40 result = write_archive(argv.argc, nargv, NULL, the_repository, NULL, 0); 40 result = write_archive(argv.nr, nargv, NULL, the_repository, NULL, 0);
41 argv_array_clear(&argv); 41 strvec_clear(&argv);
42 free(nargv); 42 free(nargv);
43 return result; 43 return result;
44} 44}