Skip to content

Commit b3ce9a0

Browse files
committed
Merge branch 'jc/checkout-merge-base'
* jc/checkout-merge-base: Fix "checkout A..." synonym for "checkout A...HEAD" on Windows
2 parents 4190564 + 72a144e commit b3ce9a0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

builtin-checkout.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -758,8 +758,10 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
758758
new.name = arg;
759759
if ((new.commit = lookup_commit_reference_gently(rev, 1))) {
760760
setup_branch_path(&new);
761-
if (resolve_ref(new.path, rev, 1, NULL))
762-
new.commit = lookup_commit_reference(rev);
761+
762+
if ((check_ref_format(new.path) == CHECK_REF_FORMAT_OK) &&
763+
resolve_ref(new.path, rev, 1, NULL))
764+
;
763765
else
764766
new.path = NULL;
765767
parse_commit(new.commit);

0 commit comments

Comments
 (0)