summaryrefslogtreecommitdiff
path: root/builtin-diff.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2007-02-09 18:51:40 -0800
committerJunio C Hamano <junkio@cox.net>2007-02-22 02:02:15 -0800
commitb4e1e4a787d3771f617182b3344dcdd9224bd0cb (patch)
treedc41f0b5f98d8028440e83857a04d8f233faf617 /builtin-diff.c
parent7b802b86a6734a47c964d84922af2a016d836882 (diff)
downloadgit-b4e1e4a787d3771f617182b3344dcdd9224bd0cb.tar.gz
run_diff_{files,index}(): update calling convention.
They used to open and read index themselves, but they now expect their callers to do so. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'builtin-diff.c')
-rw-r--r--builtin-diff.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/builtin-diff.c b/builtin-diff.c
index a6590205e8..12d11f0c55 100644
--- a/builtin-diff.c
+++ b/builtin-diff.c
@@ -56,6 +56,10 @@ static int builtin_diff_files(struct rev_info *revs,
if (revs->max_count < 0 &&
(revs->diffopt.output_format & DIFF_FORMAT_PATCH))
revs->combine_merges = revs->dense_combined_merges = 1;
+ if (read_cache() < 0) {
+ perror("read_cache");
+ return -1;
+ }
return run_diff_files(revs, silent);
}
@@ -151,6 +155,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);
}