X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=tree-diff.c;h=b05d0f43555d28f872fd5225e6773eeb636ef302;hb=4c8d4c14c6de59bc14d6118724ffee949e8654a7;hp=bbb126fc46cfb28a0bc92cc0842c0dc72017751d;hpb=e75bf76f5462af4185d8260f6feecf24dd24a516;p=git.git diff --git a/tree-diff.c b/tree-diff.c index bbb126fc4..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? */ @@ -303,7 +309,7 @@ int diff_tree(struct tree_desc *t1, struct tree_desc *t2, const char *base, stru update_tree_entry(t2); continue; } - die("git-diff-tree: internal error"); + die("git diff-tree: internal error"); } return 0; }