aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElijah Newren <newren@gmail.com>2025-05-02 19:19:11 +0000
committerJunio C Hamano <gitster@pobox.com>2025-05-02 12:44:04 -0700
commitf62977b93c89d5785ba92cb64c05850bee4a2c72 (patch)
treef22d6fe7d571a2239c4bd4acd1624a47d27d6ffc
parentCI updates (diff)
downloadgit-f62977b93c89d5785ba92cb64c05850bee4a2c72.tar.gz
git-f62977b93c89d5785ba92cb64c05850bee4a2c72.zip
tree-walk.h: fix incorrect API comment
When commit 50ddb089ff68 (tree-walk.c: remove the_repo from get_tree_entry(), 2019-06-27) added an extra parameter to get_tree_entry(), it did not fix the ordering comment about the meaning of the parameters. Rather than just changing "third"->"fourth" and "fourth"->"fifth", give the paramemters meaningful names (or actually, just take the existing names from the get_tree_entry() definition in the tree-walk.c file) and while at it, tweak the rest of the description to incorporate the other parameter names as well. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--tree-walk.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/tree-walk.h b/tree-walk.h
index aaea689f9a..29a55328bd 100644
--- a/tree-walk.h
+++ b/tree-walk.h
@@ -176,11 +176,14 @@ struct traverse_info {
};
/**
- * Find an entry in a tree given a pathname and the sha1 of a tree to
- * search. Returns 0 if the entry is found and -1 otherwise. The third
- * and fourth parameters are set to the entry's sha1 and mode respectively.
- */
-int get_tree_entry(struct repository *, const struct object_id *, const char *, struct object_id *, unsigned short *);
+ * Walk trees starting with "tree_oid" to find the entry for "name", and
+ * return the the object name and the mode of the found entry via the
+ * "oid" and "mode" parameters. Return 0 if the entry is found, and -1
+ * otherwise.
+ */
+int get_tree_entry(struct repository *repo, const struct object_id *tree_oid,
+ const char *name, struct object_id *oid,
+ unsigned short *mode);
/**
* Generate the full pathname of a tree entry based from the root of the