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
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user