Merge branch 'jc/diff-index-quick-exit-early'
* jc/diff-index-quick-exit-early: diff-index --quiet: learn the "stop feeding the backend early" logic Conflicts: unpack-trees.h
This commit is contained in:
commit
57e4d61686
@ -433,8 +433,13 @@ static int oneway_diff(struct cache_entry **src, struct unpack_trees_options *o)
|
|||||||
if (tree == o->df_conflict_entry)
|
if (tree == o->df_conflict_entry)
|
||||||
tree = NULL;
|
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);
|
do_oneway_diff(o, idx, tree);
|
||||||
|
if (diff_can_quit_early(&revs->diffopt)) {
|
||||||
|
o->exiting_early = 1;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -593,7 +593,7 @@ static int unpack_nondirectories(int n, unsigned long mask,
|
|||||||
static int unpack_failed(struct unpack_trees_options *o, const char *message)
|
static int unpack_failed(struct unpack_trees_options *o, const char *message)
|
||||||
{
|
{
|
||||||
discard_index(&o->result);
|
discard_index(&o->result);
|
||||||
if (!o->gently) {
|
if (!o->gently && !o->exiting_early) {
|
||||||
if (message)
|
if (message)
|
||||||
return error("%s", message);
|
return error("%s", message);
|
||||||
return -1;
|
return -1;
|
||||||
@ -1133,6 +1133,8 @@ return_failed:
|
|||||||
display_error_msgs(o);
|
display_error_msgs(o);
|
||||||
mark_all_ce_unused(o->src_index);
|
mark_all_ce_unused(o->src_index);
|
||||||
ret = unpack_failed(o, NULL);
|
ret = unpack_failed(o, NULL);
|
||||||
|
if (o->exiting_early)
|
||||||
|
ret = 0;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,6 +46,7 @@ struct unpack_trees_options {
|
|||||||
debug_unpack,
|
debug_unpack,
|
||||||
skip_sparse_checkout,
|
skip_sparse_checkout,
|
||||||
gently,
|
gently,
|
||||||
|
exiting_early,
|
||||||
show_all_errors,
|
show_all_errors,
|
||||||
dry_run;
|
dry_run;
|
||||||
const char *prefix;
|
const char *prefix;
|
||||||
|
Loading…
Reference in New Issue
Block a user