{"thread":{"id":"31869","subject":"[PATCH] tree-walk: use enum interesting instead of integer","startedAt":"2012-10-19T17:14:42Z","lastAt":"2012-10-19T17:14:42Z","messageCount":1,"participants":["Nguyễn Thái Ngọc Duy"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"201559","messageId":"1350666882-30138-1-git-send-email-pclouds@gmail.com","threadId":"31869","inReplyTo":null,"subject":"[PATCH] tree-walk: use enum interesting instead of integer","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2012-10-19T17:14:42Z","receivedAt":"2012-10-19T17:14:42Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Commit d688cf0 (tree_entry_interesting(): give meaningful names to\nreturn values - 2011-10-24) converts most of the tree_entry_interesting\nvalues to the new enum, except \"never_interesting\". This completes the\nconversion.\n---\n tree-walk.c | 8 ++++----\n 1 file changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/tree-walk.c b/tree-walk.c\nindex 0e49299..42fe610 100644\n--- a/tree-walk.c\n+++ b/tree-walk.c\n@@ -490,11 +490,11 @@ int get_tree_entry(const unsigned char *tree_sha1, const char *name, unsigned ch\n \n static int match_entry(const struct name_entry *entry, int pathlen,\n \t\t       const char *match, int matchlen,\n-\t\t       int *never_interesting)\n+\t\t       enum interesting *never_interesting)\n {\n \tint m = -1; /* signals that we haven't called strncmp() */\n \n-\tif (*never_interesting) {\n+\tif (*never_interesting != entry_not_interesting) {\n \t\t/*\n \t\t * We have not seen any match that sorts later\n \t\t * than the current path.\n@@ -522,7 +522,7 @@ static int match_entry(const struct name_entry *entry, int pathlen,\n \t\t * the variable to -1 and that is what will be\n \t\t * returned, allowing the caller to terminate early.\n \t\t */\n-\t\t*never_interesting = 0;\n+\t\t*never_interesting = entry_not_interesting;\n \t}\n \n \tif (pathlen > matchlen)\n@@ -584,7 +584,7 @@ enum interesting tree_entry_interesting(const struct name_entry *entry,\n {\n \tint i;\n \tint pathlen, baselen = base->len - base_offset;\n-\tint never_interesting = ps->has_wildcard ?\n+\tenum interesting never_interesting = ps->has_wildcard ?\n \t\tentry_not_interesting : all_entries_not_interesting;\n \n \tif (!ps->nr) {\n-- \n1.8.0.rc2.22.gad9383a\n"}]}