]> git.ipfire.org Git - thirdparty/git.git/blobdiff - diff.c
diff: futureproof "stop feeding the backend early" logic
[thirdparty/git.git] / diff.c
diff --git a/diff.c b/diff.c
index 91d6ea21a9d3575ea940e3d71e42609e800bed6b..ae6853fcf1ea1e10c1d8f6750f69b71a7a5e73b4 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -3513,6 +3513,13 @@ int diff_result_code(struct diff_options *opt, int status)
        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,