Merge branch 'rs/strbuf-remove-fix'
[gitweb.git] / builtin / diff.c
index 7b2a7448ed877c025f24b22c749d24dd046cc6be..7f91f6d2267db962fb7c25e92983afd4e811d43e 100644 (file)
@@ -301,9 +301,9 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
                        break;
        }
 
-       if (!no_index) {
-               prefix = setup_git_directory_gently(&nongit);
+       prefix = setup_git_directory_gently(&nongit);
 
+       if (!no_index) {
                /*
                 * Treat git diff with at least one path outside of the
                 * repo the same as if the command would have been executed
@@ -319,6 +319,7 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
 
        if (!no_index)
                gitmodules_config();
+       init_diff_ui_defaults();
        git_config(git_diff_ui_config, NULL);
        precompose_argv(argc, argv);