static struct tree *empty_tree(void)
{
- return lookup_tree(&empty_tree_oid);
+ return lookup_tree(the_hash_algo->empty_tree);
}
static int error_dirty_index(struct replay_opts *opts)
char **xopt;
static struct lock_file index_lock;
- hold_locked_index(&index_lock, LOCK_DIE_ON_ERROR);
+ if (hold_locked_index(&index_lock, LOCK_REPORT_ON_ERROR) < 0)
+ return -1;
read_cache();
oid_to_hex(&parent->object.oid));
ptree_oid = &parent->tree->object.oid;
} else {
- ptree_oid = &empty_tree_oid; /* commit is root */
+ ptree_oid = the_hash_algo->empty_tree; /* commit is root */
}
return !oidcmp(ptree_oid, &commit->tree->object.oid);
} else {
unborn = get_oid("HEAD", &head);
if (unborn)
- oidcpy(&head, &empty_tree_oid);
+ oidcpy(&head, the_hash_algo->empty_tree);
if (index_differs_from(unborn ? EMPTY_TREE_SHA1_HEX : "HEAD",
NULL, 0))
return error_dirty_index(opts);