X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=diff-lib.c;h=b3797592c63a86b46a3af0d875b6fe04ea43f536;hb=bd2c86ef00f032be925edacfc2d284ab9b6b9eab;hp=9c29293bbc05d175ba13338813e8532c7ad677cf;hpb=25d33546d474c7c28b72013c262fc23337cb3b21;p=git.git diff --git a/diff-lib.c b/diff-lib.c index 9c29293bb..b3797592c 100644 --- a/diff-lib.c +++ b/diff-lib.c @@ -379,7 +379,8 @@ static void do_oneway_diff(struct unpack_trees_options *o, if (cached && idx && ce_stage(idx)) { struct diff_filepair *pair; pair = diff_unmerge(&revs->diffopt, idx->name); - fill_filespec(pair->one, idx->sha1, idx->ce_mode); + if (tree) + fill_filespec(pair->one, tree->sha1, tree->ce_mode); return; } @@ -433,8 +434,13 @@ static int oneway_diff(struct cache_entry **src, struct unpack_trees_options *o) if (tree == o->df_conflict_entry) tree = NULL; - if (ce_path_match(idx ? idx : tree, &revs->prune_data)) + if (ce_path_match(idx ? idx : tree, &revs->prune_data)) { do_oneway_diff(o, idx, tree); + if (diff_can_quit_early(&revs->diffopt)) { + o->exiting_early = 1; + return -1; + } + } return 0; }