sha1-name.c: remove implicit dependency on the_index
This kills the_index dependency in get_oid_with_context() but for get_oid() and friends, they still assume the_repository (which also means the_index). Unfortunately the widespread use of get_oid() will make it hard to make the conversion now. We probably will add repo_get_oid() at some point and limit the use of get_oid() in builtin/ instead of forcing all get_oid() call sites to carry struct repository. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
1b0d968b34
commit
3a7a698e93
@ -508,7 +508,8 @@ static int show_blob_object(const struct object_id *oid, struct rev_info *rev, c
|
||||
!rev->diffopt.flags.allow_textconv)
|
||||
return stream_blob_to_fd(1, oid, NULL, 0);
|
||||
|
||||
if (get_oid_with_context(obj_name, GET_OID_RECORD_PATH,
|
||||
if (get_oid_with_context(the_repository, obj_name,
|
||||
GET_OID_RECORD_PATH,
|
||||
&oidc, &obj_context))
|
||||
die(_("Not a valid object name %s"), obj_name);
|
||||
if (!obj_context.path ||
|
||||
|
||||
Reference in New Issue
Block a user