diff options
| author | Junio C Hamano <junkio@cox.net> | 2006-07-29 01:54:54 -0700 |
|---|---|---|
| committer | Junio C Hamano <junkio@cox.net> | 2006-07-29 01:54:54 -0700 |
| commit | 7061cf0f205e86613c3a3306fdfedf2a5dcc8a65 (patch) | |
| tree | e0595e44fc820032fd5ee942a031439f2e6da3b1 /builtin-diff.c | |
| parent | ac64a722072bb348476a8a029de9a82073e07fba (diff) | |
| parent | a633fca0c056aa221d23493c276d3713191621b3 (diff) | |
| download | git-7061cf0f205e86613c3a3306fdfedf2a5dcc8a65.tar.xz | |
Merge branch 'lt/setup' into __/setup-n-mv
This merges the new built-in calling convention code into Johannes's
builtin-mv topic in order to resolve their conflicts early on.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'builtin-diff.c')
| -rw-r--r-- | builtin-diff.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/builtin-diff.c b/builtin-diff.c index cb38f44561..48d2fd03b7 100644 --- a/builtin-diff.c +++ b/builtin-diff.c @@ -221,7 +221,7 @@ void add_head(struct rev_info *revs) add_pending_object(revs, obj, "HEAD"); } -int cmd_diff(int argc, const char **argv, char **envp) +int cmd_diff(int argc, const char **argv, const char *prefix) { int i; struct rev_info rev; @@ -251,7 +251,7 @@ int cmd_diff(int argc, const char **argv, char **envp) */ git_config(git_diff_ui_config); - init_revisions(&rev); + init_revisions(&rev, prefix); argc = setup_revisions(argc, argv, &rev, NULL); if (!rev.diffopt.output_format) { @@ -346,7 +346,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); } |
