aboutsummaryrefslogtreecommitdiff
path: root/builtin/fetch.c
diff options
context:
space:
mode:
authorJiang Xin <worldhello.net@gmail.com>2022-01-17 08:30:45 +0800
committerJiang Xin <worldhello.net@gmail.com>2022-01-17 08:30:45 +0800
commit90999dd6864e63c23fabe2f4263c5e4ed70bd8f5 (patch)
tree65a20b6daeeb4cc9b9c95a4877b7f5745b96c46e /builtin/fetch.c
parentc8464a3df9f4ae64301f4c187d27cfa6344b3e65 (diff)
parentdf3c41adeb212432c53d93ce6ace5d5374dc6e11 (diff)
downloadgit-90999dd6864e63c23fabe2f4263c5e4ed70bd8f5.tar.xz
Merge tag 'v2.35.0-rc1'
Git 2.35-rc1 * tag 'v2.35.0-rc1': Git 2.35-rc1 reftable tests: avoid "int" overflow, use "uint64_t" reftable: avoid initializing structs from structs t1450-fsck: exec-bit is not needed to make loose object writable refs API: use "failure_errno", not "errno" Last minute fixes before -rc1 build: NonStop ships with an older zlib packfile: fix off-by-one error in decoding logic t/gpg: simplify test for unknown key branch: missing space fix at line 313 fmt-merge-msg: prevent use-after-free with signed tags cache.h: drop duplicate `ensure_full_index()` declaration lazyload: use correct calling conventions fetch: fix deadlock when cleaning up lockfiles in async signals
Diffstat (limited to 'builtin/fetch.c')
-rw-r--r--builtin/fetch.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/builtin/fetch.c b/builtin/fetch.c
index eaab8056bf..5f06b21f8e 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -223,17 +223,22 @@ static struct option builtin_fetch_options[] = {
OPT_END()
};
-static void unlock_pack(void)
+static void unlock_pack(unsigned int flags)
{
if (gtransport)
- transport_unlock_pack(gtransport);
+ transport_unlock_pack(gtransport, flags);
if (gsecondary)
- transport_unlock_pack(gsecondary);
+ transport_unlock_pack(gsecondary, flags);
+}
+
+static void unlock_pack_atexit(void)
+{
+ unlock_pack(0);
}
static void unlock_pack_on_signal(int signo)
{
- unlock_pack();
+ unlock_pack(TRANSPORT_UNLOCK_PACK_IN_SIGNAL_HANDLER);
sigchain_pop(signo);
raise(signo);
}
@@ -1329,7 +1334,7 @@ static int fetch_and_consume_refs(struct transport *transport,
trace2_region_leave("fetch", "consume_refs", the_repository);
out:
- transport_unlock_pack(transport);
+ transport_unlock_pack(transport, 0);
return ret;
}
@@ -1978,7 +1983,7 @@ static int fetch_one(struct remote *remote, int argc, const char **argv,
gtransport->server_options = &server_options;
sigchain_push_common(unlock_pack_on_signal);
- atexit(unlock_pack);
+ atexit(unlock_pack_atexit);
sigchain_push(SIGPIPE, SIG_IGN);
exit_code = do_fetch(gtransport, &rs);
sigchain_pop(SIGPIPE);