From 02c339640e92eacac46531f189e454141882c910 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Tue, 17 Dec 2024 19:48:03 +0900 Subject: [PATCH] try --- git-core | 2 +- src/build.mk | 6 +++++- src/cinnabar-fast-import.c | 14 +++++++------- src/http.c.patch | 18 +++++++++--------- src/packfile.c.patch | 16 +++++++++------- 5 files changed, 31 insertions(+), 25 deletions(-) diff --git a/git-core b/git-core index 2cd22437f..063bcebf0 160000 --- a/git-core +++ b/git-core @@ -1 +1 @@ -Subproject commit 2cd22437f64229935dc564db969cbcbfed5e9045 +Subproject commit 063bcebf0c917140ca0e705cbe0fdea127e90086 diff --git a/src/build.mk b/src/build.mk index 723810ff5..82f3bd3c9 100644 --- a/src/build.mk +++ b/src/build.mk @@ -13,6 +13,7 @@ NO_UNIX_SOCKETS ?= 1 SOURCE_DIR = $(subst \,/,$(CARGO_MANIFEST_DIR)) vpath %.c $(SOURCE_DIR)/git-core +vpath version-def.h.in $(SOURCE_DIR)/git-core $(SOURCE_DIR)/git-core/Makefile: git -C $(SOURCE_DIR) submodule sync @@ -35,7 +36,10 @@ FAKE_INCLUDE := 1 FAKE_INCLUDE := include $(SOURCE_DIR)/git-core/Makefile -GIT-VERSION-FILE: GIT-VERSION-GEN +GIT-VERSION-FILE: GIT-VERSION-GEN GIT-VERSION-FILE.in +GIT-VERSION-FILE.in: $(SOURCE_DIR)/git-core/GIT-VERSION-FILE.in + cat $< > $@ + GIT-VERSION-GEN detect-compiler: echo "#!/bin/sh" > $@ echo ". $(SOURCE_DIR)/git-core/$@" >> $@ diff --git a/src/cinnabar-fast-import.c b/src/cinnabar-fast-import.c index fc0e744c1..6ed73f4fc 100644 --- a/src/cinnabar-fast-import.c +++ b/src/cinnabar-fast-import.c @@ -51,6 +51,8 @@ void real_hashwrite(struct hashfile *, const void *, unsigned int); void hashwrite(struct hashfile *f, const void *buf, unsigned int count) { size_t window_size; + size_t packed_git_window_size = + the_repository->settings.packed_git_window_size; if (f != pack_file) { real_hashwrite(f, buf, count); @@ -111,21 +113,19 @@ void hashwrite(struct hashfile *f, const void *buf, unsigned int count) } } -off_t real_find_pack_entry_one(const unsigned char *sha1, +off_t real_find_pack_entry_one(const struct object_id *oid, struct packed_git *p); -off_t find_pack_entry_one(const unsigned char *sha1, struct packed_git *p) +off_t find_pack_entry_one(const struct object_id *oid, struct packed_git *p) { if (p == pack_data) { - struct object_id oid; struct object_entry *oe; - oidread(&oid, sha1, the_repository->hash_algo); - oe = get_object_entry(&oid); + oe = get_object_entry(oid); if (oe) return oe->idx.offset; return 0; } - return real_find_pack_entry_one(sha1, p); + return real_find_pack_entry_one(oid, p); } struct object_entry *get_object_entry(const struct object_id *oid) @@ -194,7 +194,7 @@ static void cleanup(void) initialized = 0; if (cinnabar_check(CHECK_HELPER)) - pack_report(); + pack_report(the_repository); } void do_cleanup(int rollback) diff --git a/src/http.c.patch b/src/http.c.patch index 03a232d1f..8d2002656 100644 --- a/src/http.c.patch +++ b/src/http.c.patch @@ -1,17 +1,17 @@ diff --git a/http.c b/http.c -index c89f96ceba..d6284df1e2 100644 +index c7a55ae9cd..55dfba24ac 100644 --- a/http.c +++ b/http.c -@@ -68,7 +68,7 @@ static char *curl_no_proxy; - #ifdef GIT_CURL_HAVE_CURLOPT_PINNEDPUBLICKEY +@@ -63,7 +63,7 @@ static char *ssl_key_type; + static char *ssl_capath; + static char *curl_no_proxy; static char *ssl_pinnedkey; - #endif -static char *ssl_cainfo; +char *ssl_cainfo; static long curl_low_speed_limit = -1; static long curl_low_speed_time = -1; static int curl_ftp_no_epsv; -@@ -423,11 +423,13 @@ static int http_options(const char *var, const char *value, +@@ -410,11 +410,13 @@ static int http_options(const char *var, const char *value, curl_ssl_try = git_config_bool(var, value); return 0; } @@ -24,10 +24,10 @@ index c89f96ceba..d6284df1e2 100644 +#endif if (!strcmp("http.schannelcheckrevoke", var)) { - if (value && !strcmp(value, "best-effort")) { -@@ -1369,9 +1371,6 @@ void http_init(struct remote *remote, const char *url, int proactive_auth) + http_schannel_check_revoke = git_config_bool(var, value); +@@ -1301,9 +1303,6 @@ void http_init(struct remote *remote, const char *url, int proactive_auth) + } } - #endif - if (curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) - die("curl_global_init failed"); @@ -35,7 +35,7 @@ index c89f96ceba..d6284df1e2 100644 if (proactive_auth && http_proactive_auth == PROACTIVE_AUTH_NONE) http_proactive_auth = PROACTIVE_AUTH_IF_CREDENTIALS; -@@ -1459,7 +1458,6 @@ void http_cleanup(void) +@@ -1391,7 +1390,6 @@ void http_cleanup(void) curl_easy_cleanup(curl_default); curl_multi_cleanup(curlm); diff --git a/src/packfile.c.patch b/src/packfile.c.patch index 570d2f99d..5f1048684 100644 --- a/src/packfile.c.patch +++ b/src/packfile.c.patch @@ -1,15 +1,17 @@ diff --git a/packfile.c b/packfile.c -index c0d7dd93f4..d797afff0e 100644 +index 9c4bd81a8c..a8a82c0cdf 100644 --- a/packfile.c +++ b/packfile.c -@@ -1951,7 +1951,9 @@ off_t nth_packed_object_offset(const struct packed_git *p, uint32_t n) +@@ -1993,8 +1993,10 @@ off_t nth_packed_object_offset(const struct packed_git *p, uint32_t n) } } --off_t find_pack_entry_one(const unsigned char *sha1, -+off_t real_find_pack_entry_one(const unsigned char *sha1, -+ struct packed_git *p); -+off_t real_find_pack_entry_one(const unsigned char *sha1, - struct packed_git *p) +-off_t find_pack_entry_one(const struct object_id *oid, +- struct packed_git *p) ++off_t real_find_pack_entry_one(const struct object_id *oid, ++ struct packed_git *p); ++off_t real_find_pack_entry_one(const struct object_id *oid, ++ struct packed_git *p) { const unsigned char *index = p->index_data; + uint32_t result;