return commit_graft_table[index]->oid.hash;
}
-static int commit_graft_pos(const unsigned char *sha1)
+#define commit_graft_pos(r, s) commit_graft_pos_##r(s)
+static int commit_graft_pos_the_repository(const unsigned char *sha1)
{
return sha1_pos(sha1, the_repository->parsed_objects->grafts,
the_repository->parsed_objects->grafts_nr,
int register_commit_graft(struct commit_graft *graft, int ignore_dups)
{
- int pos = commit_graft_pos(graft->oid.hash);
+ int pos = commit_graft_pos(the_repository, graft->oid.hash);
if (0 <= pos) {
if (ignore_dups)
{
int pos;
prepare_commit_graft();
- pos = commit_graft_pos(oid->hash);
+ pos = commit_graft_pos(the_repository, oid->hash);
if (pos < 0)
return NULL;
return the_repository->parsed_objects->grafts[pos];
int unregister_shallow(const struct object_id *oid)
{
- int pos = commit_graft_pos(oid->hash);
+ int pos = commit_graft_pos(the_repository, oid->hash);
if (pos < 0)
return -1;
if (pos + 1 < the_repository->parsed_objects->grafts_nr)