Git fork

Merge branch 'tc/last-modified-recursive-fix'

"git last-modified" operating in non-recursive mode used to trigger
a BUG(), which has been corrected.

* tc/last-modified-recursive-fix:
last-modified: fix bug when some paths remain unhandled

+26 -1
+1
builtin/last-modified.c
··· 265 265 lm->rev.boundary = 1; 266 266 lm->rev.no_commit_id = 1; 267 267 lm->rev.diff = 1; 268 + lm->rev.diffopt.flags.no_recursive_diff_tree_combined = 1; 268 269 lm->rev.diffopt.flags.recursive = lm->recursive; 269 270 lm->rev.diffopt.flags.tree_in_recursive = lm->show_trees; 270 271
+2 -1
combine-diff.c
··· 1515 1515 1516 1516 diffopts = *opt; 1517 1517 copy_pathspec(&diffopts.pathspec, &opt->pathspec); 1518 - diffopts.flags.recursive = 1; 1519 1518 diffopts.flags.allow_external = 0; 1519 + if (!opt->flags.no_recursive_diff_tree_combined) 1520 + diffopts.flags.recursive = 1; 1520 1521 1521 1522 /* find set of paths that everybody touches 1522 1523 *
+7
diff.h
··· 127 127 unsigned recursive; 128 128 unsigned tree_in_recursive; 129 129 130 + /* 131 + * Historically diff_tree_combined() overrides recursive to 1. To 132 + * suppress this behavior, set the flag below. 133 + * It has no effect if recursive is already set to 1. 134 + */ 135 + unsigned no_recursive_diff_tree_combined; 136 + 130 137 /* Affects the way how a file that is seemingly binary is treated. */ 131 138 unsigned binary; 132 139 unsigned text;
+16
t/t8020-last-modified.sh
··· 128 128 EOF 129 129 ' 130 130 131 + test_expect_success 'last-modified with subdir and criss-cross merge' ' 132 + git checkout -b branch-k1 1 && 133 + mkdir -p a k && 134 + test_commit k1 a/file2 && 135 + git checkout -b branch-k2 && 136 + test_commit k2 k/file2 && 137 + git checkout branch-k1 && 138 + test_merge km2 branch-k2 && 139 + test_merge km3 3 && 140 + check_last_modified <<-\EOF 141 + km3 a 142 + k2 k 143 + 1 file 144 + EOF 145 + ' 146 + 131 147 test_expect_success 'cross merge boundaries in blaming' ' 132 148 git checkout HEAD^0 && 133 149 git rm -rf . &&