ls-tree: rename "retval" to "recurse" in "show_tree()"

The variable which "show_tree()" return is named "retval", a name that's a little hard to understand. The commit rename "retval" to "recurse" which is a more meaningful name than before in the context. We do not need to take a look at "read_tree_at()" in "tree.c" to make sure what does "retval" mean. Signed-off-by: Teng Long <dyroneteng@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Teng Long committed Mar 23, 2022 at 17:13 UTC 889f78383eb1e93663ad38a231607e04a1593713
1 file changed +4 -4
builtin/ls-tree.c
+4 -4
@@ -64,7 +64,7 @@ static int show_recursive(const char *base, size_t baselen, const char *pathname
64 static int show_tree(const struct object_id *oid, struct strbuf *base,
65 const char *pathname, unsigned mode, void *context)
66 {
67 - int retval = 0;
67 + int recurse = 0;
68 size_t baselen;
69 enum object_type type = OBJ_BLOB;
70
@@ -72,9 +72,9 @@ static int show_tree(const struct object_id *oid, struct strbuf *base,
72 type = OBJ_COMMIT;
73 } else if (S_ISDIR(mode)) {
74 if (show_recursive(base->buf, base->len, pathname)) {
75 - retval = READ_TREE_RECURSIVE;
75 + recurse = READ_TREE_RECURSIVE;
76 if (!(ls_options & LS_SHOW_TREES))
77 - return retval;
77 + return recurse;
78 }
79 type = OBJ_TREE;
80 }
@@ -109,7 +109,7 @@ static int show_tree(const struct object_id *oid, struct strbuf *base,
109 chomp_prefix ? ls_tree_prefix : NULL,
110 stdout, line_termination);
111 strbuf_setlen(base, baselen);
112 - return retval;
112 + return recurse;
113 }
114
115 int cmd_ls_tree(int argc, const char **argv, const char *prefix)