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

Function already_written

object-file.c:1099–1114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1097}
1098
1099static int already_written(struct odb_transaction_files *transaction,
1100 struct object_id *oid)
1101{
1102 /* The object may already exist in the repository */
1103 if (odb_has_object(transaction->base.source->odb, oid,
1104 ODB_HAS_OBJECT_RECHECK_PACKED | ODB_HAS_OBJECT_FETCH_PROMISOR))
1105 return 1;
1106
1107 /* Might want to keep the list sorted */
1108 for (uint32_t i = 0; i < transaction->packfile.nr_written; i++)
1109 if (oideq(&transaction->packfile.written[i]->oid, oid))
1110 return 1;
1111
1112 /* This is a new object we need to keep */
1113 return 0;
1114}
1115
1116/* Lazily create backing packfile for the state */
1117static void prepare_packfile_transaction(struct odb_transaction_files *transaction)

Calls 2

odb_has_objectFunction · 0.85
oideqFunction · 0.85

Tested by

no test coverage detected