summaryrefslogtreecommitdiff
path: root/builtin-diff.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin-diff.c')
-rw-r--r--builtin-diff.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/builtin-diff.c b/builtin-diff.c
index 54bbf025d9..45faa2067a 100644
--- a/builtin-diff.c
+++ b/builtin-diff.c
@@ -117,6 +117,10 @@ static int builtin_diff_index(struct rev_info *revs,
revs->max_count != -1 || revs->min_age != -1 ||
revs->max_age != -1)
usage(builtin_diff_usage);
+ if (read_cache() < 0) {
+ perror("read_cache");
+ return -1;
+ }
return run_diff_index(revs, cached);
}