summaryrefslogtreecommitdiff
path: root/builtin-checkout.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-01-13 12:31:13 -0800
committerJunio C Hamano <gitster@pobox.com>2010-01-13 12:31:13 -0800
commit1f73566af5bec28cd8489c6139a9ede95817349c (patch)
treeb1deca9888bc171d09420d927bbe694795cf5d83 /builtin-checkout.c
parent5b9c0a699bdf9727d25eceb7b980dbede96bfd8e (diff)
parent230a4566382860fc26a3f8d578a41c6504cf865f (diff)
downloadgit-1f73566af5bec28cd8489c6139a9ede95817349c.tar.gz
Merge branch 'jc/checkout-merge-base'
* jc/checkout-merge-base: rebase -i: teach --onto A...B syntax rebase: fix --onto A...B parsing and add tests "rebase --onto A...B" replays history on the merge base between A and B "checkout A...B" switches to the merge base between A and B
Diffstat (limited to 'builtin-checkout.c')
-rw-r--r--builtin-checkout.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/builtin-checkout.c b/builtin-checkout.c
index 2708669383..793542eb06 100644
--- a/builtin-checkout.c
+++ b/builtin-checkout.c
@@ -696,7 +696,10 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
* case 3: git checkout <something> [<paths>]
*
* With no paths, if <something> is a commit, that is to
- * switch to the branch or detach HEAD at it.
+ * switch to the branch or detach HEAD at it. As a special case,
+ * if <something> is A...B (missing A or B means HEAD but you can
+ * omit at most one side), and if there is a unique merge base
+ * between A and B, A...B names that merge base.
*
* With no paths, if <something> is _not_ a commit, no -t nor -b
* was given, and there is a tracking branch whose name is
@@ -722,7 +725,7 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
if (!strcmp(arg, "-"))
arg = "@{-1}";
- if (get_sha1(arg, rev)) {
+ if (get_sha1_mb(arg, rev)) {
if (has_dash_dash) /* case (1) */
die("invalid reference: %s", arg);
if (!patch_mode &&