History

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

Christian Hesse committed 6 years ago

Commit 629659d1 parent 205837d7 files · +36 −36Browse files

Unified · Split

7 files
  1. Makefile +1 −1
  2. cgit.h +1 −1
  3. git +1 −1
  4. tests/t0109-gitconfig.sh +1 −1
  5. ui-blame.c +5 −5
  6. ui-log.c +15 −15
  7. ui-snapshot.c +12 −12
Makefile+1−1
@@ -14,7 +14,7 @@ htmldir = $(docdir) · 13 unmodified lines
14pdfdir = $(docdir)14pdfdir = $(docdir)
15mandir = $(prefix)/share/man15mandir = $(prefix)/share/man
16SHA1_HEADER = <openssl/sha.h>16SHA1_HEADER = <openssl/sha.h>
17GIT_VER = 2.28.017GIT_VER = 2.29.0
18GIT_URL = https://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.xz18GIT_URL = https://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.xz
19INSTALL = install19INSTALL = install
20COPYTREE = cp -r20COPYTREE = cp -r
cgit.h+1−1
@@ -14,7 +14,7 @@ · 13 unmodified lines
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>
git+1−1
@@ -1 +1 @@
1Subproject commit 47ae905ffb98cc4d4fd90083da6bc8dab55d9ecc1Subproject commit 69986e19ffcfb9af674ae5180689ab7bbf92ed28
tests/t0109-gitconfig.sh+1−1
@@ -25,7 +25,7 @@ test_no_home_access () { · 24 unmodified lines
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.out28 ! grep "$non_existent_path" strace.out
29}29}
30 30
31test_no_home_access_success() {31test_no_home_access_success() {
ui-blame.c+5−5
@@ -10,7 +10,7 @@ · 9 unmodified lines
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, · 87 unmodified lines
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, · 13 unmodified lines
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;
ui-log.c+15−15
@@ -10,7 +10,7 @@ · 9 unmodified lines
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 · 349 unmodified lines
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 token388 /* 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 * rev-list options. Also, replace the previously390 * 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 · 8 unmodified lines
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 · 2 unmodified lines
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;
ui-snapshot.c+12−12
@@ -13,32 +13,32 @@ · 12 unmodified lines
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 new31 * Now we need to copy the pointers to arguments into a new
32 * structure because write_archive will rearrange its arguments32 * structure because write_archive will rearrange its arguments
33 * which may result in duplicated/missing entries causing leaks33 * 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}