From: Junio C Hamano Date: Thu, 2 Jul 2009 02:40:47 +0000 (-0700) Subject: Merge branch 'ne/maint-1.6.0-diff-tree-t-r-show-directory' X-Git-Tag: v1.6.4-rc0~28 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/4197195bee15f120e99d797b22108fd274235fd7?ds=inline;hp=-c Merge branch 'ne/maint-1.6.0-diff-tree-t-r-show-directory' * ne/maint-1.6.0-diff-tree-t-r-show-directory: diff-tree -r -t: include added/removed directories in the output --- 4197195bee15f120e99d797b22108fd274235fd7 diff --combined tree-diff.c index edd83949bf,c83a8da392..0459e54d3d --- a/tree-diff.c +++ b/tree-diff.c @@@ -118,16 -118,10 +118,16 @@@ static int tree_entry_interesting(struc 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? */ @@@ -239,6 -233,12 +239,12 @@@ static void show_entry(struct diff_opti if (!tree || type != OBJ_TREE) die("corrupt tree sha %s", sha1_to_hex(sha1)); + if (DIFF_OPT_TST(opt, TREE_IN_RECURSIVE)) { + newbase[baselen + pathlen] = 0; + opt->add_remove(opt, *prefix, mode, sha1, newbase); + newbase[baselen + pathlen] = '/'; + } + init_tree_desc(&inner, tree, size); show_tree(opt, prefix, &inner, newbase, baselen + 1 + pathlen); @@@ -374,7 -374,7 +380,7 @@@ static void try_to_follow_renames(struc } /* - * Then, discard all the non-relevane file pairs... + * Then, discard all the non-relevant file pairs... */ for (i = 0; i < q->nr; i++) { struct diff_filepair *p = q->queue[i];