summaryrefslogtreecommitdiff
path: root/builtin-checkout.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-01-12 07:24:42 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-01-12 07:24:42 (GMT)
commit687004b512d30daeff0e64dc718f803433d73329 (patch)
tree3f3aaaa2de75ecf63178c9b82029df598a803c9b /builtin-checkout.c
parent4fc988efe66ea079c926b1f01bf563a946b7797f (diff)
parent3442ea4a75a3c76f65efac71b414584f765e5a99 (diff)
downloadgit-687004b512d30daeff0e64dc718f803433d73329.zip
git-687004b512d30daeff0e64dc718f803433d73329.tar.gz
git-687004b512d30daeff0e64dc718f803433d73329.tar.bz2
Merge branch 'jc/maint-do-not-switch-to-non-commit' into maint
* 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);