summaryrefslogtreecommitdiff
path: root/sha1-name.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2019-06-27 09:28:49 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-06-27 19:45:17 (GMT)
commit50ddb089ff68dfe1e3d9bd9a108d9015c176f761 (patch)
tree521e1975379ac6f30c33a8ebe59e5b1d9ad0852f /sha1-name.c
parent5e575807337d15dbecf88767e709df08304e3b94 (diff)
downloadgit-50ddb089ff68dfe1e3d9bd9a108d9015c176f761.zip
git-50ddb089ff68dfe1e3d9bd9a108d9015c176f761.tar.gz
git-50ddb089ff68dfe1e3d9bd9a108d9015c176f761.tar.bz2
tree-walk.c: remove the_repo from get_tree_entry()
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 'sha1-name.c')
-rw-r--r--sha1-name.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sha1-name.c b/sha1-name.c
index 728e6f1..e8fb215 100644
--- a/sha1-name.c
+++ b/sha1-name.c
@@ -1677,7 +1677,8 @@ int repo_get_oid_blob(struct repository *r,
}
/* Must be called only when object_name:filename doesn't exist. */
-static void diagnose_invalid_oid_path(const char *prefix,
+static void diagnose_invalid_oid_path(struct repository *r,
+ const char *prefix,
const char *filename,
const struct object_id *tree_oid,
const char *object_name,
@@ -1695,7 +1696,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, fullname, &oid, &mode)) {
+ if (!get_tree_entry(r, tree_oid, fullname, &oid, &mode)) {
die("Path '%s' exists, but not '%s'.\n"
"Did you mean '%.*s:%s' aka '%.*s:./%s'?",
fullname,
@@ -1902,10 +1903,10 @@ static enum get_oid_result get_oid_with_context_1(struct repository *repo,
filename, oid, &oc->symlink_path,
&oc->mode);
} else {
- ret = get_tree_entry(&tree_oid, filename, oid,
+ ret = get_tree_entry(repo, &tree_oid, filename, oid,
&oc->mode);
if (ret && only_to_die) {
- diagnose_invalid_oid_path(prefix,
+ diagnose_invalid_oid_path(repo, prefix,
filename,
&tree_oid,
name, len);