Skip to content

Commit 889f783

Browse files
dyronegitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 132ceda commit 889f783

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

builtin/ls-tree.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,17 +64,17 @@ static int show_recursive(const char *base, size_t baselen, const char *pathname
6464
static int show_tree(const struct object_id *oid, struct strbuf *base,
6565
const char *pathname, unsigned mode, void *context)
6666
{
67-
int retval = 0;
67+
int recurse = 0;
6868
size_t baselen;
6969
enum object_type type = OBJ_BLOB;
7070

7171
if (S_ISGITLINK(mode)) {
7272
type = OBJ_COMMIT;
7373
} else if (S_ISDIR(mode)) {
7474
if (show_recursive(base->buf, base->len, pathname)) {
75-
retval = READ_TREE_RECURSIVE;
75+
recurse = READ_TREE_RECURSIVE;
7676
if (!(ls_options & LS_SHOW_TREES))
77-
return retval;
77+
return recurse;
7878
}
7979
type = OBJ_TREE;
8080
}
@@ -109,7 +109,7 @@ static int show_tree(const struct object_id *oid, struct strbuf *base,
109109
chomp_prefix ? ls_tree_prefix : NULL,
110110
stdout, line_termination);
111111
strbuf_setlen(base, baselen);
112-
return retval;
112+
return recurse;
113113
}
114114

115115
int cmd_ls_tree(int argc, const char **argv, const char *prefix)

0 commit comments

Comments
 (0)