Merge branch 'jk/diff-relative-cached-unmerged-more'
The code path that deals with relative paths in the 'diff-lib' has been cleaned up. * jk/diff-relative-cached-unmerged-more: diff-lib: skip paths outside prefix in oneway_diff() diff-lib: drop stale comment about advancing o->posmain
commit
babe559ffb
|
|
@ -508,11 +508,9 @@ static void do_oneway_diff(struct unpack_trees_options *o,
|
||||||
* For diffing, the index is more important, and we only have a
|
* For diffing, the index is more important, and we only have a
|
||||||
* single tree.
|
* single tree.
|
||||||
*
|
*
|
||||||
* We're supposed to advance o->pos to skip what we have already processed.
|
|
||||||
*
|
|
||||||
* This wrapper makes it all more readable, and takes care of all
|
* This wrapper makes it all more readable, and takes care of all
|
||||||
* the fairly complex unpack_trees() semantic requirements, including
|
* the fairly complex unpack_trees() semantic requirements, including
|
||||||
* the skipping, the path matching, the type conflict cases etc.
|
* the path matching, the type conflict cases etc.
|
||||||
*/
|
*/
|
||||||
static int oneway_diff(const struct cache_entry * const *src,
|
static int oneway_diff(const struct cache_entry * const *src,
|
||||||
struct unpack_trees_options *o)
|
struct unpack_trees_options *o)
|
||||||
|
|
@ -540,6 +538,11 @@ static int oneway_diff(const struct cache_entry * const *src,
|
||||||
if (!idx && !tree)
|
if (!idx && !tree)
|
||||||
BUG("oneway_diff with neither idx nor tree");
|
BUG("oneway_diff with neither idx nor tree");
|
||||||
|
|
||||||
|
if (revs->diffopt.prefix &&
|
||||||
|
strncmp((idx ? idx : tree)->name, revs->diffopt.prefix,
|
||||||
|
revs->diffopt.prefix_length))
|
||||||
|
return 0;
|
||||||
|
|
||||||
if (ce_path_match(revs->diffopt.repo->index,
|
if (ce_path_match(revs->diffopt.repo->index,
|
||||||
idx ? idx : tree,
|
idx ? idx : tree,
|
||||||
&revs->prune_data, NULL)) {
|
&revs->prune_data, NULL)) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue