diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2019-01-12 03:13:28 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-01-14 21:13:04 +0100 |
commit | 3a7a698e93e1031c322ab20c0e336e205514c058 (patch) | |
tree | d0df6168901db7e9a028ca4dac330f8798341a3b /builtin/cat-file.c | |
parent | read-cache.c: replace update_index_if_able with repo_& (diff) | |
download | git-3a7a698e93e1031c322ab20c0e336e205514c058.tar.xz git-3a7a698e93e1031c322ab20c0e336e205514c058.zip |
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>
Diffstat (limited to 'builtin/cat-file.c')
-rw-r--r-- | builtin/cat-file.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/builtin/cat-file.c b/builtin/cat-file.c index 2ca56fd086..7622c502f0 100644 --- a/builtin/cat-file.c +++ b/builtin/cat-file.c @@ -73,7 +73,8 @@ static int cat_one_file(int opt, const char *exp_type, const char *obj_name, if (unknown_type) flags |= OBJECT_INFO_ALLOW_UNKNOWN_TYPE; - if (get_oid_with_context(obj_name, GET_OID_RECORD_PATH, + if (get_oid_with_context(the_repository, obj_name, + GET_OID_RECORD_PATH, &oid, &obj_context)) die("Not a valid object name %s", obj_name); @@ -382,7 +383,8 @@ static void batch_one_object(const char *obj_name, int flags = opt->follow_symlinks ? GET_OID_FOLLOW_SYMLINKS : 0; enum follow_symlinks_result result; - result = get_oid_with_context(obj_name, flags, &data->oid, &ctx); + result = get_oid_with_context(the_repository, obj_name, + flags, &data->oid, &ctx); if (result != FOUND) { switch (result) { case MISSING_OBJECT: |