{"thread":{"id":"1329","subject":"[PATCH] Extend git-ls-files --exclude option to match against directories","startedAt":"2005-07-24T08:12:25Z","lastAt":"2005-07-24T08:12:25Z","messageCount":1,"participants":["Marco Costalba"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"6407","messageId":"20050724081225.81671.qmail@web26304.mail.ukl.yahoo.com","threadId":"1329","inReplyTo":null,"subject":"[PATCH] Extend git-ls-files --exclude option to match against directories","fromName":"Marco Costalba","fromEmail":"mcostalba@yahoo.it","sentAt":"2005-07-24T08:12:25Z","receivedAt":"2005-07-24T08:12:25Z","isPatch":true,"sender":{"key":"mcostalba@gmail.com","avatar":null},"body":"Pattern in git-ls-files --exclude=<pattern> can include directories\nas example git-ls-files --exclude=Documentation/* will do what you expect\n---\n\n ls-files.c |    4 +---\n 1 files changed, 1 insertions(+), 3 deletions(-)\n\nc8fdfc1f8280a753baf13c293db573c4e50f0a99\ndiff --git a/ls-files.c b/ls-files.c\n--- a/ls-files.c\n+++ b/ls-files.c\n@@ -80,10 +80,8 @@ static int excluded(const char *pathname\n {\n \tint i;\n \tif (nr_excludes) {\n-\t\tconst char *basename = strrchr(pathname, '/');\n-\t\tbasename = (basename) ? basename+1 : pathname;\n \t\tfor (i = 0; i < nr_excludes; i++)\n-\t\t\tif (fnmatch(excludes[i], basename, 0) == 0)\n+\t\t\tif (fnmatch(excludes[i], pathname, FNM_PATHNAME) == 0)\n \t\t\t\treturn 1;\n \t}\n \treturn 0;\n\n\n__________________________________________________\nDo You Yahoo!?\nTired of spam?  Yahoo! Mail has the best spam protection around \nhttp://mail.yahoo.com \n"}]}