diff options
Diffstat (limited to 'builtin-diff.c')
-rw-r--r-- | builtin-diff.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/builtin-diff.c b/builtin-diff.c index cb38f44561..dca223235d 100644 --- a/builtin-diff.c +++ b/builtin-diff.c @@ -250,8 +250,9 @@ int cmd_diff(int argc, const char **argv, char **envp) * Other cases are errors. */ - git_config(git_diff_ui_config); init_revisions(&rev); + git_config(git_diff_ui_config); + diff_setup(&rev.diffopt); argc = setup_revisions(argc, argv, &rev, NULL); if (!rev.diffopt.output_format) { @@ -346,7 +347,15 @@ int cmd_diff(int argc, const char **argv, char **envp) return builtin_diff_index(&rev, argc, argv); else if (ents == 2) return builtin_diff_tree(&rev, argc, argv, ent); + else if ((ents == 3) && (ent[0].item->flags & UNINTERESTING)) { + /* diff A...B where there is one sane merge base between + * A and B. We have ent[0] == merge-base, ent[1] == A, + * and ent[2] == B. Show diff between the base and B. + */ + return builtin_diff_tree(&rev, argc, argv, ent); + } else - return builtin_diff_combined(&rev, argc, argv, ent, ents); + return builtin_diff_combined(&rev, argc, argv, + ent, ents); usage(builtin_diff_usage); } |