From: Junio C Hamano Date: Sat, 25 Jul 2026 21:06:10 +0000 (-0700) Subject: Merge branch 'ps/cat-file-remote-object-info' into ps/cat-file-remote-object-info... X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=669c4ad5dc61cca394860909d28152293d6fcdef;p=thirdparty%2Fgit.git Merge branch 'ps/cat-file-remote-object-info' into ps/cat-file-remote-object-info-type * ps/cat-file-remote-object-info: cat-file: make remote-object-info allow-list adapt to the server cat-file: add remote-object-info to batch-command transport: add client support for object-info serve: advertise object-info feature protocol-caps: check object existence regardless of the attributes requested fetch-pack: move fetch initialization connect: make write_fetch_command_and_capabilities() more generic fetch-pack: move write_fetch_command_and_capabilities() to connect.c fetch-pack: use unsigned int for hash_algo variable fetch-pack: drop the static advertise_sid variable t1006: extract helper functions into new 'lib-cat-file.sh' cat-file: declare loop counter inside for() transport-helper: fix memory leak of helper on disconnect --- 669c4ad5dc61cca394860909d28152293d6fcdef diff --cc object-file.c index 7ff2b730ac,121416c37c..c5809db598 --- a/object-file.c +++ b/object-file.c @@@ -1714,29 -1695,16 +1714,39 @@@ int odb_transaction_files_begin(struct transaction->base.source = source; transaction->base.commit = odb_transaction_files_commit; transaction->base.write_object_stream = odb_transaction_files_write_object_stream; + transaction->base.env = odb_transaction_files_env; + + transaction->prefix = "bulk-fsync"; + if (flags & ODB_TRANSACTION_RECEIVE) { + /* + * ODB transactions for git-receive-pack(1) eagerly create a + * temporary directory and use a different temporary directory + * prefix. + * + * NEEDSWORK: This transaction flag is only used by the "files" + * backend to special case temporary directory set up and + * handling. Ideally transaction users should not have to care + * though. To avoid this, we could eagerly create the temporary + * directory and use the same prefix name for all transactions. + */ + transaction->prefix = "incoming"; + if (odb_transaction_files_prepare(&transaction->base)) { + free(transaction); + return -1; + } + } + + *out = &transaction->base; - return &transaction->base; + return 0; } + + void free_object_info_contents(struct object_info *object_info) + { + if (!object_info) + return; + free(object_info->typep); + free(object_info->sizep); + free(object_info->disk_sizep); + free(object_info->delta_base_oid); + }