MCPcopy Create free account
hub / github.com/git/git / prepare_packfile_transaction

Function prepare_packfile_transaction

object-file.c:1117–1131  ·  view source on GitHub ↗

Lazily create backing packfile for the state */

Source from the content-addressed store, hash-verified

1115
1116/* Lazily create backing packfile for the state */
1117static void prepare_packfile_transaction(struct odb_transaction_files *transaction)
1118{
1119 struct transaction_packfile *state = &transaction->packfile;
1120 if (state->f)
1121 return;
1122
1123 state->f = create_tmp_packfile(transaction->base.source->odb->repo,
1124 &state->pack_tmp_name);
1125 reset_pack_idx_option(&state->pack_idx_opts);
1126
1127 /* Pretend we are going to write only one object */
1128 state->offset = write_pack_header(state->f, 1);
1129 if (!state->offset)
1130 die_errno("unable to write pack header");
1131}
1132
1133static int hash_blob_stream(struct odb_write_stream *stream,
1134 const struct git_hash_algo *hash_algo,

Calls 4

create_tmp_packfileFunction · 0.85
reset_pack_idx_optionFunction · 0.85
write_pack_headerFunction · 0.85
die_errnoFunction · 0.85

Tested by

no test coverage detected