X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-diff.c;h=d75d69bf5774ffd402bbeec47b9a0e0800554d63;hb=bf0fe35c938ac9f03d1369600b0c76e428a57507;hp=7ceceeb6ff49d60468293941b5f37141e8fc01b9;hpb=42fc11c1103a88c49233f04dc0c2f5659b3973fe;p=git.git diff --git a/builtin-diff.c b/builtin-diff.c index 7ceceeb6f..d75d69bf5 100644 --- a/builtin-diff.c +++ b/builtin-diff.c @@ -134,8 +134,8 @@ 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"); + if (read_cache_preload(revs->diffopt.paths) < 0) { + perror("read_cache_preload"); return -1; } return run_diff_index(revs, cached); @@ -234,8 +234,8 @@ static int builtin_diff_files(struct rev_info *revs, int argc, const char **argv revs->combine_merges = revs->dense_combined_merges = 1; setup_work_tree(); - if (read_cache() < 0) { - perror("read_cache"); + if (read_cache_preload(revs->diffopt.paths) < 0) { + perror("read_cache_preload"); return -1; } result = run_diff_files(revs, options); @@ -290,6 +290,10 @@ int cmd_diff(int argc, const char **argv, const char *prefix) /* Otherwise, we are doing the usual "git" diff */ rev.diffopt.skip_stat_unmatch = !!diff_auto_refresh_index; + /* Default to let external and textconv be used */ + DIFF_OPT_SET(&rev.diffopt, ALLOW_EXTERNAL); + DIFF_OPT_SET(&rev.diffopt, ALLOW_TEXTCONV); + if (nongit) die("Not a git repository"); argc = setup_revisions(argc, argv, &rev, NULL); @@ -298,9 +302,8 @@ int cmd_diff(int argc, const char **argv, const char *prefix) if (diff_setup_done(&rev.diffopt) < 0) die("diff_setup_done failed"); } - DIFF_OPT_SET(&rev.diffopt, ALLOW_EXTERNAL); + DIFF_OPT_SET(&rev.diffopt, RECURSIVE); - DIFF_OPT_SET(&rev.diffopt, ALLOW_TEXTCONV); /* * If the user asked for our exit code then don't start a