X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=tree-diff.c;h=b05d0f43555d28f872fd5225e6773eeb636ef302;hb=7183c09d11ac4b98f1cc78f29dcbd85df5533001;hp=9f67af6c1fbb9130962cd373d8e2ebecf543c640;hpb=718258e256b74622aa55f5ee0cb9cff4cce6bf9f;p=git.git diff --git a/tree-diff.c b/tree-diff.c index 9f67af6c1..b05d0f435 100644 --- a/tree-diff.c +++ b/tree-diff.c @@ -118,10 +118,16 @@ static int tree_entry_interesting(struct tree_desc *desc, const char *base, int continue; /* - * The base is a subdirectory of a path which - * was specified, so all of them are interesting. + * If the base is a subdirectory of a path which + * was specified, all of them are interesting. */ - return 2; + if (!matchlen || + base[matchlen] == '/' || + match[matchlen - 1] == '/') + return 2; + + /* Just a random prefix match */ + continue; } /* Does the base match? */