hash: require hash algorithm in oidread()
and oidclr()
Both `oidread()` and `oidclr()` use `the_repository` to derive the hash function that shall be used. Require callers to pass in the hash algorithm to get rid of this implicit dependency. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
f4836570a7
commit
9da95bda74
@ -650,7 +650,7 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
|
||||
die(_("'%s' is not a valid tag name."), tag);
|
||||
|
||||
if (refs_read_ref(get_main_ref_store(the_repository), ref.buf, &prev))
|
||||
oidclr(&prev);
|
||||
oidclr(&prev, the_repository->hash_algo);
|
||||
else if (!force)
|
||||
die(_("tag '%s' already exists"), tag);
|
||||
|
||||
|
Reference in New Issue
Block a user