Skip to content

Commit 2c9f56f

Browse files
committed
git: update to v2.19.1
Update to git version v2.19.1. Required changes follow upstream commits: * commit: add repository argument to get_cached_commit_buffer (3ce85f7e5a41116145179f0fae2ce6d86558d099) * commit: add repository argument to lookup_commit_reference (2122f6754c93be8f02bfb5704ed96c88fc9837a8) * object: add repository argument to parse_object (109cd76dd3467bd05f8d2145b857006649741d5c) * tag: add repository argument to deref_tag (a74093da5ed601a09fa158e5ba6f6f14c1142a3e) * tag: add repository argument to lookup_tag (ce71efb713f97f476a2d2ab541a0c73f684a5db3) * tree: add repository argument to lookup_tree (f86bcc7b2ce6cad68ba1a48a528e380c6126705e) * archive.c: avoid access to the_index (b612ee202a48f129f81f8f6a5af6cf71d1a9caef) * for_each_*_object: move declarations to object-store.h (0889aae1cd18c1804ba01c1a4229e516dfb9fe9b) Signed-off-by: Christian Hesse <[email protected]>
1 parent a96f289 commit 2c9f56f

File tree

15 files changed

+24
-23
lines changed

15 files changed

+24
-23
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ htmldir = $(docdir)
1414
pdfdir = $(docdir)
1515
mandir = $(prefix)/share/man
1616
SHA1_HEADER = <openssl/sha.h>
17-
GIT_VER = 2.18.0
17+
GIT_VER = 2.19.1
1818
GIT_URL = https://www.kernel.org/pub/software/scm/git/git-$(GIT_VER).tar.gz
1919
INSTALL = install
2020
COPYTREE = cp -r

cgit.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <cache.h>
99
#include <grep.h>
1010
#include <object.h>
11+
#include <object-store.h>
1112
#include <tree.h>
1213
#include <commit.h>
1314
#include <tag.h>

git

Submodule git updated from 53f9a3e to cae598d

parsing.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ struct commitinfo *cgit_parse_commit(struct commit *commit)
129129
{
130130
const int sha1hex_len = 40;
131131
struct commitinfo *ret;
132-
const char *p = get_cached_commit_buffer(commit, NULL);
132+
const char *p = get_cached_commit_buffer(the_repository, commit, NULL);
133133
const char *t;
134134

135135
ret = xcalloc(1, sizeof(struct commitinfo));

shared.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ static struct refinfo *cgit_mk_refinfo(const char *refname, const struct object_
161161

162162
ref = xmalloc(sizeof (struct refinfo));
163163
ref->refname = xstrdup(refname);
164-
ref->object = parse_object(oid);
164+
ref->object = parse_object(the_repository, oid);
165165
switch (ref->object->type) {
166166
case OBJ_TAG:
167167
ref->tag = cgit_parse_tag((struct tag *)ref->object);

ui-blame.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ void cgit_print_blame(void)
278278
"Invalid revision name: %s", rev);
279279
return;
280280
}
281-
commit = lookup_commit_reference(&oid);
281+
commit = lookup_commit_reference(the_repository, &oid);
282282
if (!commit || parse_commit(commit)) {
283283
cgit_print_error_page(404, "Not found",
284284
"Invalid commit reference: %s", rev);

ui-blob.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ int cgit_ref_path_exists(const char *path, const char *ref, int file_only)
5656
goto done;
5757
if (oid_object_info(the_repository, &oid, &size) != OBJ_COMMIT)
5858
goto done;
59-
read_tree_recursive(lookup_commit_reference(&oid)->maybe_tree, "", 0, 0, &paths, walk_tree, &walk_tree_ctx);
59+
read_tree_recursive(lookup_commit_reference(the_repository, &oid)->maybe_tree, "", 0, 0, &paths, walk_tree, &walk_tree_ctx);
6060

6161
done:
6262
free(path_items.match);
@@ -89,7 +89,7 @@ int cgit_print_file(char *path, const char *head, int file_only)
8989
return -1;
9090
type = oid_object_info(the_repository, &oid, &size);
9191
if (type == OBJ_COMMIT) {
92-
commit = lookup_commit_reference(&oid);
92+
commit = lookup_commit_reference(the_repository, &oid);
9393
read_tree_recursive(commit->maybe_tree, "", 0, 0, &paths, walk_tree, &walk_tree_ctx);
9494
if (!walk_tree_ctx.found_path)
9595
return -1;
@@ -145,7 +145,7 @@ void cgit_print_blob(const char *hex, char *path, const char *head, int file_onl
145145
type = oid_object_info(the_repository, &oid, &size);
146146

147147
if ((!hex) && type == OBJ_COMMIT && path) {
148-
commit = lookup_commit_reference(&oid);
148+
commit = lookup_commit_reference(the_repository, &oid);
149149
read_tree_recursive(commit->maybe_tree, "", 0, 0, &paths, walk_tree, &walk_tree_ctx);
150150
type = oid_object_info(the_repository, &oid, &size);
151151
}

ui-clone.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ static int print_ref_info(const char *refname, const struct object_id *oid,
1919
{
2020
struct object *obj;
2121

22-
if (!(obj = parse_object(oid)))
22+
if (!(obj = parse_object(the_repository, oid)))
2323
return 0;
2424

2525
htmlf("%s\t%s\n", oid_to_hex(oid), refname);
2626
if (obj->type == OBJ_TAG) {
27-
if (!(obj = deref_tag(obj, refname, 0)))
27+
if (!(obj = deref_tag(the_repository, obj, refname, 0)))
2828
return 0;
2929
htmlf("%s\t%s^{}\n", oid_to_hex(&obj->oid), refname);
3030
}

ui-commit.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ void cgit_print_commit(char *hex, const char *prefix)
3131
"Bad object id: %s", hex);
3232
return;
3333
}
34-
commit = lookup_commit_reference(&oid);
34+
commit = lookup_commit_reference(the_repository, &oid);
3535
if (!commit) {
3636
cgit_print_error_page(404, "Not found",
3737
"Bad commit reference: %s", hex);
@@ -87,7 +87,7 @@ void cgit_print_commit(char *hex, const char *prefix)
8787
free(tmp);
8888
html("</td></tr>\n");
8989
for (p = commit->parents; p; p = p->next) {
90-
parent = lookup_commit_reference(&p->item->object.oid);
90+
parent = lookup_commit_reference(the_repository, &p->item->object.oid);
9191
if (!parent) {
9292
html("<tr><td colspan='3'>");
9393
cgit_print_error("Error reading parent commit");

ui-diff.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ void cgit_print_diff(const char *new_rev, const char *old_rev,
407407
"Bad object name: %s", new_rev);
408408
return;
409409
}
410-
commit = lookup_commit_reference(new_rev_oid);
410+
commit = lookup_commit_reference(the_repository, new_rev_oid);
411411
if (!commit || parse_commit(commit)) {
412412
cgit_print_error_page(404, "Not found",
413413
"Bad commit: %s", oid_to_hex(new_rev_oid));
@@ -428,7 +428,7 @@ void cgit_print_diff(const char *new_rev, const char *old_rev,
428428
}
429429

430430
if (!is_null_oid(old_rev_oid)) {
431-
commit2 = lookup_commit_reference(old_rev_oid);
431+
commit2 = lookup_commit_reference(the_repository, old_rev_oid);
432432
if (!commit2 || parse_commit(commit2)) {
433433
cgit_print_error_page(404, "Not found",
434434
"Bad commit: %s", oid_to_hex(old_rev_oid));

ui-patch.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ void cgit_print_patch(const char *new_rev, const char *old_rev,
3636
"Bad object id: %s", new_rev);
3737
return;
3838
}
39-
commit = lookup_commit_reference(&new_rev_oid);
39+
commit = lookup_commit_reference(the_repository, &new_rev_oid);
4040
if (!commit) {
4141
cgit_print_error_page(404, "Not found",
4242
"Bad commit reference: %s", new_rev);
@@ -49,7 +49,7 @@ void cgit_print_patch(const char *new_rev, const char *old_rev,
4949
"Bad object id: %s", old_rev);
5050
return;
5151
}
52-
if (!lookup_commit_reference(&old_rev_oid)) {
52+
if (!lookup_commit_reference(the_repository, &old_rev_oid)) {
5353
cgit_print_error_page(404, "Not found",
5454
"Bad commit reference: %s", old_rev);
5555
return;

ui-plain.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ void cgit_print_plain(void)
185185
cgit_print_error_page(404, "Not found", "Not found");
186186
return;
187187
}
188-
commit = lookup_commit_reference(&oid);
188+
commit = lookup_commit_reference(the_repository, &oid);
189189
if (!commit || parse_commit(commit)) {
190190
cgit_print_error_page(404, "Not found", "Not found");
191191
return;

ui-snapshot.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ static int write_archive_type(const char *format, const char *hex, const char *p
3737
/* argv_array guarantees a trailing NULL entry. */
3838
memcpy(nargv, argv.argv, sizeof(char *) * (argv.argc + 1));
3939

40-
result = write_archive(argv.argc, nargv, NULL, NULL, 0);
40+
result = write_archive(argv.argc, nargv, NULL, the_repository, NULL, 0);
4141
argv_array_clear(&argv);
4242
free(nargv);
4343
return result;
@@ -147,7 +147,7 @@ static int make_snapshot(const struct cgit_snapshot_format *format,
147147
"Bad object id: %s", hex);
148148
return 1;
149149
}
150-
if (!lookup_commit_reference(&oid)) {
150+
if (!lookup_commit_reference(the_repository, &oid)) {
151151
cgit_print_error_page(400, "Bad request",
152152
"Not a commit reference: %s", hex);
153153
return 1;

ui-tag.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ void cgit_print_tag(char *revname)
5353
"Bad tag reference: %s", revname);
5454
goto cleanup;
5555
}
56-
obj = parse_object(&oid);
56+
obj = parse_object(the_repository, &oid);
5757
if (!obj) {
5858
cgit_print_error_page(500, "Internal server error",
5959
"Bad object id: %s", oid_to_hex(&oid));
@@ -63,7 +63,7 @@ void cgit_print_tag(char *revname)
6363
struct tag *tag;
6464
struct taginfo *info;
6565

66-
tag = lookup_tag(&oid);
66+
tag = lookup_tag(the_repository, &oid);
6767
if (!tag || parse_tag(tag) || !(info = cgit_parse_tag(tag))) {
6868
cgit_print_error_page(500, "Internal server error",
6969
"Bad tag object: %s", revname);

ui-tree.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ static void write_tree_link(const struct object_id *oid, char *name,
177177
cgit_tree_link(name, NULL, "ls-dir", ctx.qry.head, rev,
178178
fullpath->buf);
179179

180-
tree = lookup_tree(&tree_ctx.oid);
180+
tree = lookup_tree(the_repository, &tree_ctx.oid);
181181
if (!tree)
182182
return;
183183

@@ -359,7 +359,7 @@ void cgit_print_tree(const char *rev, char *path)
359359
"Invalid revision name: %s", rev);
360360
return;
361361
}
362-
commit = lookup_commit_reference(&oid);
362+
commit = lookup_commit_reference(the_repository, &oid);
363363
if (!commit || parse_commit(commit)) {
364364
cgit_print_error_page(404, "Not found",
365365
"Invalid commit reference: %s", rev);

0 commit comments

Comments
 (0)