]> git.ipfire.org Git - thirdparty/git.git/blobdiff - diff.c
Merge remote-tracking branch 'ko/maint' into jc/diff-index-quick-exit-early
[thirdparty/git.git] / diff.c
diff --git a/diff.c b/diff.c
index 9a8012e362fe2bc08d4ecce21e68972579c3693b..7d1cdea310b95a93e63ab834475951d8c082c6c2 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -4288,6 +4288,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));
+}
+
 /*
  * Shall changes to this submodule be ignored?
  *