struct cache_entry *ce = active_cache[i];
int changed;
- if (DIFF_OPT_TST(&revs->diffopt, QUICK) &&
- !revs->diffopt.filter &&
- DIFF_OPT_TST(&revs->diffopt, HAS_CHANGES))
+ if (diff_can_quit_early(&revs->diffopt))
break;
if (!ce_path_match(ce, revs->prune_data))
return result;
}
+int diff_can_quit_early(struct diff_options *opt)
+{
+ return (DIFF_OPT_TST(opt, QUICK) &&
+ !opt->filter &&
+ DIFF_OPT_TST(opt, HAS_CHANGES));
+}
+
void diff_addremove(struct diff_options *options,
int addremove, unsigned mode,
const unsigned char *sha1,
void diff_set_mnemonic_prefix(struct diff_options *options, const char *a, const char *b);
+extern int diff_can_quit_early(struct diff_options *);
+
extern void diff_addremove(struct diff_options *,
int addremove,
unsigned mode,
int baselen = strlen(base);
for (;;) {
- if (DIFF_OPT_TST(opt, QUICK) &&
- !opt->filter &&
- DIFF_OPT_TST(opt, HAS_CHANGES))
+ if (diff_can_quit_early(opt))
break;
if (opt->nr_paths) {
skip_uninteresting(t1, base, baselen, opt);