summaryrefslogtreecommitdiff
path: root/builtin-checkout.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-01-03 21:57:30 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-01-03 21:57:30 (GMT)
commit8ea6ae99b2314ddb24dd9121335b7a5583047f05 (patch)
tree4041eec5fe9cfc6ba30192cee72a10f6125179c7 /builtin-checkout.c
parentcaf8b2fbd4b49c66aa70624eaf35ebcdc007ad6d (diff)
parent3442ea4a75a3c76f65efac71b414584f765e5a99 (diff)
downloadgit-8ea6ae99b2314ddb24dd9121335b7a5583047f05.zip
git-8ea6ae99b2314ddb24dd9121335b7a5583047f05.tar.gz
git-8ea6ae99b2314ddb24dd9121335b7a5583047f05.tar.bz2
Merge branch 'jc/maint-do-not-switch-to-non-commit'
* jc/maint-do-not-switch-to-non-commit: git checkout: do not allow switching to a tree-ish that is not a commit
Diffstat (limited to 'builtin-checkout.c')
-rw-r--r--builtin-checkout.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin-checkout.c b/builtin-checkout.c
index c2c0561..b5dd9c0 100644
--- a/builtin-checkout.c
+++ b/builtin-checkout.c
@@ -681,8 +681,8 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
argv++;
argc--;
+ new.name = arg;
if ((new.commit = lookup_commit_reference_gently(rev, 1))) {
- new.name = arg;
setup_branch_path(&new);
if (resolve_ref(new.path, rev, 1, NULL))
new.commit = lookup_commit_reference(rev);