diff options
| author | Jiang Xin <worldhello.net@gmail.com> | 2022-01-17 08:30:45 +0800 |
|---|---|---|
| committer | Jiang Xin <worldhello.net@gmail.com> | 2022-01-17 08:30:45 +0800 |
| commit | 90999dd6864e63c23fabe2f4263c5e4ed70bd8f5 (patch) | |
| tree | 65a20b6daeeb4cc9b9c95a4877b7f5745b96c46e /transport.c | |
| parent | c8464a3df9f4ae64301f4c187d27cfa6344b3e65 (diff) | |
| parent | df3c41adeb212432c53d93ce6ace5d5374dc6e11 (diff) | |
| download | git-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 'transport.c')
| -rw-r--r-- | transport.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/transport.c b/transport.c index 92ab9a3fa6..2a3e324154 100644 --- a/transport.c +++ b/transport.c @@ -1456,13 +1456,18 @@ int transport_fetch_refs(struct transport *transport, struct ref *refs) return rc; } -void transport_unlock_pack(struct transport *transport) +void transport_unlock_pack(struct transport *transport, unsigned int flags) { + int in_signal_handler = !!(flags & TRANSPORT_UNLOCK_PACK_IN_SIGNAL_HANDLER); int i; for (i = 0; i < transport->pack_lockfiles.nr; i++) - unlink_or_warn(transport->pack_lockfiles.items[i].string); - string_list_clear(&transport->pack_lockfiles, 0); + if (in_signal_handler) + unlink(transport->pack_lockfiles.items[i].string); + else + unlink_or_warn(transport->pack_lockfiles.items[i].string); + if (!in_signal_handler) + string_list_clear(&transport->pack_lockfiles, 0); } int transport_connect(struct transport *transport, const char *name, |
