summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
Diffstat (limited to 'builtin')
-rw-r--r--builtin/diff.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin/diff.c b/builtin/diff.c
index 7b2a7448ed..7be7806146 100644
--- a/builtin/diff.c
+++ b/builtin/diff.c
@@ -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