Skip to content

Commit

Permalink
Merge branch 'jc/diff'
Browse files Browse the repository at this point in the history
* jc/diff:
  git-diff A...B to (usually) mean "git-diff `git-merge-base A B` B"
  • Loading branch information
Junio C Hamano committed Jul 28, 2006
2 parents 5afa69b + 9919f41 commit f789f82
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion builtin-diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,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);
}

0 comments on commit f789f82

Please sign in to comment.