]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin-diff.c
Call setup_git_directory() early
[thirdparty/git.git] / builtin-diff.c
index dca223235de6ef61407bd7e7625687ab71918186..45b27cfca3975d4661651f98e951a0357686a961 100644 (file)
@@ -227,7 +227,7 @@ int cmd_diff(int argc, const char **argv, char **envp)
        struct rev_info rev;
        struct object_array_entry ent[100];
        int ents = 0, blobs = 0, paths = 0;
-       const char *path = NULL;
+       const char *path = NULL, *prefix;
        struct blobinfo blob[2];
 
        /*
@@ -250,9 +250,9 @@ int cmd_diff(int argc, const char **argv, char **envp)
         * Other cases are errors.
         */
 
-       init_revisions(&rev);
+       prefix = setup_git_directory();
        git_config(git_diff_ui_config);
-       diff_setup(&rev.diffopt);
+       init_revisions(&rev, prefix);
 
        argc = setup_revisions(argc, argv, &rev, NULL);
        if (!rev.diffopt.output_format) {