shallow: convert shallow registration functions to object_id

Convert register_shallow and unregister_shallow to take struct
object_id.  register_shallow is a caller of lookup_commit, which we will
convert later.  It doesn't make sense for the registration and
unregistration functions to have incompatible interfaces, so convert
them both.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
brian m. carlson
2017-05-06 22:10:06 +00:00
committed by Junio C Hamano
parent 68ab61dd09
commit e92b848cb6
7 changed files with 20 additions and 20 deletions

View File

@ -216,9 +216,9 @@ int for_each_commit_graft(each_commit_graft_fn fn, void *cb_data)
return ret;
}
int unregister_shallow(const unsigned char *sha1)
int unregister_shallow(const struct object_id *oid)
{
int pos = commit_graft_pos(sha1);
int pos = commit_graft_pos(oid->hash);
if (pos < 0)
return -1;
if (pos + 1 < commit_graft_nr)