Skip to content

Commit c3a47ca

Browse files
pcloudsgitster
authored andcommitted
tree-walk: use enum interesting instead of integer
Commit d688cf0 (tree_entry_interesting(): give meaningful names to return values - 2011-10-24) converts most of the tree_entry_interesting values to the new enum, except "never_interesting". This completes the conversion. Signed-off-by: Junio C Hamano <[email protected]>
1 parent d688cf0 commit c3a47ca

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tree-walk.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -490,11 +490,11 @@ int get_tree_entry(const unsigned char *tree_sha1, const char *name, unsigned ch
490490

491491
static int match_entry(const struct name_entry *entry, int pathlen,
492492
const char *match, int matchlen,
493-
int *never_interesting)
493+
enum interesting *never_interesting)
494494
{
495495
int m = -1; /* signals that we haven't called strncmp() */
496496

497-
if (*never_interesting) {
497+
if (*never_interesting != entry_not_interesting) {
498498
/*
499499
* We have not seen any match that sorts later
500500
* than the current path.
@@ -522,7 +522,7 @@ static int match_entry(const struct name_entry *entry, int pathlen,
522522
* the variable to -1 and that is what will be
523523
* returned, allowing the caller to terminate early.
524524
*/
525-
*never_interesting = 0;
525+
*never_interesting = entry_not_interesting;
526526
}
527527

528528
if (pathlen > matchlen)
@@ -584,7 +584,7 @@ enum interesting tree_entry_interesting(const struct name_entry *entry,
584584
{
585585
int i;
586586
int pathlen, baselen = base->len - base_offset;
587-
int never_interesting = ps->has_wildcard ?
587+
enum interesting never_interesting = ps->has_wildcard ?
588588
entry_not_interesting : all_entries_not_interesting;
589589

590590
if (!ps->nr) {

0 commit comments

Comments
 (0)