summaryrefslogtreecommitdiff
path: root/builtin/ls-tree.c
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2025-09-10 19:16:30 +0200
committerJunio C Hamano <gitster@pobox.com>2025-09-10 14:29:49 -0700
commita66fc22bf9b7f379fc68e23c54d42ac9b7eaa845 (patch)
tree280c7a9da4a8dc45e06af9d88b72420a340ea36c /builtin/ls-tree.c
parentc44beea485f0f2feaf460e2ac87fdd5608d63cf0 (diff)
use repo_get_oid_with_flags()
get_oid_with_context() allows specifying flags and reports object details via a passed-in struct object_context. Some callers just want to specify flags, but don't need any details back. Convert them to repo_get_oid_with_flags(), which provides just that and frees them from dealing with the context structure. Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/ls-tree.c')
-rw-r--r--builtin/ls-tree.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/builtin/ls-tree.c b/builtin/ls-tree.c
index 5d55731ca3..ec6940fc7c 100644
--- a/builtin/ls-tree.c
+++ b/builtin/ls-tree.c
@@ -373,7 +373,6 @@ int cmd_ls_tree(int argc,
OPT_END()
};
struct ls_tree_cmdmode_to_fmt *m2f = ls_tree_cmdmode_format;
- struct object_context obj_context = {0};
int ret;
repo_config(the_repository, git_default_config, NULL);
@@ -405,9 +404,8 @@ int cmd_ls_tree(int argc,
ls_tree_usage, ls_tree_options);
if (argc < 1)
usage_with_options(ls_tree_usage, ls_tree_options);
- if (get_oid_with_context(the_repository, argv[0],
- GET_OID_HASH_ANY, &oid,
- &obj_context))
+ if (repo_get_oid_with_flags(the_repository, argv[0], &oid,
+ GET_OID_HASH_ANY))
die("Not a valid object name %s", argv[0]);
/*
@@ -447,6 +445,5 @@ int cmd_ls_tree(int argc,
ret = !!read_tree(the_repository, tree, &options.pathspec, fn, &options);
clear_pathspec(&options.pathspec);
- object_context_release(&obj_context);
return ret;
}