mirror of
https://github.com/git/git.git
synced 2024-10-31 22:37:54 +01:00
Make "git checkout" verify that the argument refers to a commit
We still need to create a new branch if it didn't refer to an existing branch, otherwise our HEAD will continue to point to something totally different than what we just checked out. I'll need to think about it. Maybe only do it with "-f" and force it to the "master" branch?
This commit is contained in:
parent
79162bb8ad
commit
714fff2aa8
1 changed files with 1 additions and 1 deletions
|
@ -13,7 +13,7 @@ while [ "$#" != "0" ]; do
|
|||
force=1
|
||||
;;
|
||||
*)
|
||||
rev=$(git-rev-parse --verify --revs-only "$arg")
|
||||
rev=$(git-rev-parse --verify --revs-only "$arg^0") || exit
|
||||
if [ -z "$rev" ]; then
|
||||
echo "unknown flag $arg"
|
||||
exit 1
|
||||
|
|
Loading…
Reference in a new issue