From 1ffb93f88feadf2c376787a844efadf3fe6c519b Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Wed, 9 Jun 2021 17:44:38 +0900 Subject: [PATCH] Update git-core to v2.32.0 --- CI/tools.py | 2 +- git-core | 2 +- helper/GIT-VERSION.mk | 2 +- helper/cinnabar-fast-import.c | 5 +++-- helper/cinnabar-helper.c | 6 ++---- helper/cinnabar-notes.c | 3 ++- helper/csum-file.c.patch | 4 ++-- helper/hg-data.h | 2 ++ helper/tree-walk.c.patch | 4 ++-- 9 files changed, 16 insertions(+), 14 deletions(-) diff --git a/CI/tools.py b/CI/tools.py index 60ba7156..7a04289f 100644 --- a/CI/tools.py +++ b/CI/tools.py @@ -12,7 +12,7 @@ MERCURIAL_VERSION = '5.7.1' -GIT_VERSION = '2.31.1' +GIT_VERSION = '2.32.0' ALL_MERCURIAL_VERSIONS = ( '1.9.3', '2.0.2', '2.1.2', '2.2.3', '2.3.2', '2.4.2', '2.5.4', diff --git a/git-core b/git-core index 48bf2fa8..ebf3c04b 160000 --- a/git-core +++ b/git-core @@ -1 +1 @@ -Subproject commit 48bf2fa8bad054d66bd79c6ba903c89c704201f7 +Subproject commit ebf3c04b262aa27fbb97f8a0156c2347fecafafb diff --git a/helper/GIT-VERSION.mk b/helper/GIT-VERSION.mk index 98387e8f..72cc8446 100644 --- a/helper/GIT-VERSION.mk +++ b/helper/GIT-VERSION.mk @@ -1,2 +1,2 @@ -GIT_VERSION ?= v2.31.1 +GIT_VERSION ?= v2.32.0 WINDOWS_GIT_VERSION ?= $(GIT_VERSION).windows.1 diff --git a/helper/cinnabar-fast-import.c b/helper/cinnabar-fast-import.c index 88d23a69..2e7d5b47 100644 --- a/helper/cinnabar-fast-import.c +++ b/helper/cinnabar-fast-import.c @@ -106,6 +106,7 @@ void *get_object_entry(const unsigned char *sha1) { struct object_id oid; hashcpy(oid.hash, sha1); + oid.algo = GIT_HASH_SHA1; return find_object(&oid); } @@ -220,7 +221,7 @@ static void end_packfile() const struct object_id empty_tree = { { 0x4b, 0x82, 0x5d, 0xc6, 0x42, 0xcb, 0x6e, 0xb9, 0xa0, 0x60, 0xe5, 0x4b, 0xf8, 0xd6, 0x92, 0x88, 0xfb, 0xee, 0x49, 0x04, -} }; +}, GIT_HASH_SHA1 }; /* Override fast-import.c's parse_mark_ref to allow a syntax for * mercurial sha1s, resolved through hg2git. Hack: it uses a fixed @@ -1285,7 +1286,7 @@ void store_git_commit(struct strbuf *commit_buf, struct object_id *result) const struct object_id empty_blob = { { 0xe6, 0x9d, 0xe2, 0x9b, 0xb2, 0xd1, 0xd6, 0x43, 0x4b, 0x8b, 0x29, 0xae, 0x77, 0x5a, 0xd8, 0xc2, 0xe4, 0x8c, 0x53, 0x91, -} }; +}, GIT_HASH_SHA1 }; const struct object_id *ensure_empty_blob() { struct object_entry *oe = find_object((struct object_id *)&empty_blob); diff --git a/helper/cinnabar-helper.c b/helper/cinnabar-helper.c index ea12a3e0..f75ec846 100644 --- a/helper/cinnabar-helper.c +++ b/helper/cinnabar-helper.c @@ -253,8 +253,7 @@ struct ls_tree_context { }; static int fill_ls_tree(const struct object_id *oid, struct strbuf *base, - const char *pathname, unsigned mode, int stage, - void *context) + const char *pathname, unsigned mode, void *context) { struct ls_tree_context *ctx = context; struct strbuf *buf = &ctx->buf; @@ -299,8 +298,7 @@ static void do_ls_tree(struct string_list *args) goto not_found; memset(&match_all, 0, sizeof(match_all)); - read_tree_recursive(the_repository, tree, "", 0, 0, &match_all, - fill_ls_tree, &ctx); + read_tree(the_repository, tree, &match_all, fill_ls_tree, &ctx); send_buffer(&ctx.buf); strbuf_release(&ctx.buf); diff --git a/helper/cinnabar-notes.c b/helper/cinnabar-notes.c index 55b1b2f1..e04794e2 100644 --- a/helper/cinnabar-notes.c +++ b/helper/cinnabar-notes.c @@ -145,7 +145,8 @@ int cinnabar_remove_note(struct cinnabar_notes_tree *t, if (!result) { struct object_id oid; hashcpy(oid.hash, object_sha1); - add_note(&t->additions, &oid, &null_oid, NULL); + oid.algo = GIT_HASH_SHA1; + add_note(&t->additions, &oid, null_oid(), NULL); } return result && result2; } diff --git a/helper/csum-file.c.patch b/helper/csum-file.c.patch index c653496d..ff52d148 100644 --- a/helper/csum-file.c.patch +++ b/helper/csum-file.c.patch @@ -1,5 +1,5 @@ diff --git a/csum-file.c b/csum-file.c -index 0f35fa5ee4..cee7bd5aeb 100644 +index 7510950fa3..19d02e3a63 100644 --- a/csum-file.c +++ b/csum-file.c @@ -86,7 +86,7 @@ int finalize_hashfile(struct hashfile *f, unsigned char *result, unsigned int fl @@ -10,4 +10,4 @@ index 0f35fa5ee4..cee7bd5aeb 100644 +void real_hashwrite(struct hashfile *f, const void *buf, unsigned int count) { while (count) { - unsigned offset = f->offset; + unsigned left = sizeof(f->buffer) - f->offset; diff --git a/helper/hg-data.h b/helper/hg-data.h index 6156f6e6..37295176 100644 --- a/helper/hg-data.h +++ b/helper/hg-data.h @@ -43,11 +43,13 @@ static inline void hg_oidcpy2git(struct object_id *dst, { memcpy(dst->hash, src->hash, 20); memset(dst->hash + 20, 0, the_hash_algo->rawsz - 20); + dst->algo = GIT_HASH_SHA1; } static inline void oidcpy2hg(struct hg_object_id *dst, const struct object_id *src) { + assert(src->algo == GIT_HASH_SHA1); memcpy(dst->hash, src->hash, 20); } diff --git a/helper/tree-walk.c.patch b/helper/tree-walk.c.patch index fdd738a5..5a2d87bd 100644 --- a/helper/tree-walk.c.patch +++ b/helper/tree-walk.c.patch @@ -1,5 +1,5 @@ diff --git a/tree-walk.c b/tree-walk.c -index d5a8e096a6..cace4fd6cf 100644 +index 3a94959d64..70558d2964 100644 --- a/tree-walk.c +++ b/tree-walk.c @@ -47,7 +47,7 @@ static int decode_tree_entry(struct tree_desc *desc, const char *buf, unsigned l @@ -9,5 +9,5 @@ index d5a8e096a6..cace4fd6cf 100644 - desc->entry.mode = canon_mode(mode); + desc->entry.mode = mode; desc->entry.pathlen = len - 1; - hashcpy(desc->entry.oid.hash, (const unsigned char *)path + len); + oidread(&desc->entry.oid, (const unsigned char *)path + len);