Lazily create backing packfile for the state */
| 1115 | |
| 1116 | /* Lazily create backing packfile for the state */ |
| 1117 | static 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 | |
| 1133 | static int hash_blob_stream(struct odb_write_stream *stream, |
| 1134 | const struct git_hash_algo *hash_algo, |
no test coverage detected