tree-walk: convert tree entry functions to object_id

Convert get_tree_entry and find_tree_entry to take pointers to struct
object_id.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
brian m. carlson
2018-03-12 02:27:51 +00:00
committed by Junio C Hamano
parent 575042a04f
commit 916bc35b29
11 changed files with 31 additions and 35 deletions

View File

@ -1529,8 +1529,7 @@ static void diagnose_invalid_oid_path(const char *prefix,
if (is_missing_file_error(errno)) {
char *fullname = xstrfmt("%s%s", prefix, filename);
if (!get_tree_entry(tree_oid->hash, fullname,
oid.hash, &mode)) {
if (!get_tree_entry(tree_oid, fullname, &oid, &mode)) {
die("Path '%s' exists, but not '%s'.\n"
"Did you mean '%.*s:%s' aka '%.*s:./%s'?",
fullname,
@ -1722,8 +1721,8 @@ static int get_oid_with_context_1(const char *name,
filename, oid->hash, &oc->symlink_path,
&oc->mode);
} else {
ret = get_tree_entry(tree_oid.hash, filename,
oid->hash, &oc->mode);
ret = get_tree_entry(&tree_oid, filename, oid,
&oc->mode);
if (ret && only_to_die) {
diagnose_invalid_oid_path(prefix,
filename,