diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2019-01-12 09:13:28 +0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-01-14 12:13:04 -0800 |
commit | 3a7a698e93e1031c322ab20c0e336e205514c058 (patch) | |
tree | d0df6168901db7e9a028ca4dac330f8798341a3b /builtin/rev-parse.c | |
parent | read-cache.c: replace update_index_if_able with repo_& (diff) | |
download | tgif-3a7a698e93e1031c322ab20c0e336e205514c058.tar.xz |
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/rev-parse.c')
-rw-r--r-- | builtin/rev-parse.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin/rev-parse.c b/builtin/rev-parse.c index 10d4dab894..910a71ed8b 100644 --- a/builtin/rev-parse.c +++ b/builtin/rev-parse.c @@ -933,7 +933,8 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix) name++; type = REVERSED; } - if (!get_oid_with_context(name, flags, &oid, &unused)) { + if (!get_oid_with_context(the_repository, name, + flags, &oid, &unused)) { if (verify) revs_count++; else |