Make gc a builtin.
[gitweb.git] / builtin-diff.c
index 28b660a780f9f2ae48acf5e8d3dc7c7aee178de2..4efbb8237bd49e8717a42833b2d9b2db064b45ac 100644 (file)
@@ -215,7 +215,10 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
        git_config(git_diff_ui_config);
        init_revisions(&rev, prefix);
 
-       argc = setup_revisions(argc, argv, &rev, NULL);
+       if (!setup_diff_no_index(&rev, argc, argv, nongit, prefix))
+               argc = 0;
+       else
+               argc = setup_revisions(argc, argv, &rev, NULL);
        if (!rev.diffopt.output_format) {
                rev.diffopt.output_format = DIFF_FORMAT_PATCH;
                if (diff_setup_done(&rev.diffopt) < 0)