X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=tree.c;h=0d703a0c473e65c60d9e130b4e1fd50b79e9462b;hb=d8c81dfcaf3ac4bab0f0f8f54d2c4ae0425abcbf;hp=25d2e29fa8b1dfb964b97a10898c77d8fe86ef78;hpb=b5a18787bd5c757b49a7ea4fdd73e62a1fee35de;p=git.git diff --git a/tree.c b/tree.c index 25d2e29fa..0d703a0c4 100644 --- a/tree.c +++ b/tree.c @@ -60,8 +60,12 @@ static int match_tree_entry(const char *base, int baselen, const char *path, uns /* If it doesn't match, move along... */ if (strncmp(base, match, matchlen)) continue; - /* The base is a subdirectory of a path which was specified. */ - return 1; + /* pathspecs match only at the directory boundaries */ + if (!matchlen || + base[matchlen] == '/' || + match[matchlen - 1] == '/') + return 1; + continue; } /* Does the base match? */