Merge branch 'maint'

* maint:
  checkout: do not get confused with ambiguous tag/branch names
This commit is contained in:
Junio C Hamano
2007-06-08 02:55:19 -07:00
2 changed files with 42 additions and 1 deletions

View File

@ -63,12 +63,13 @@ while [ "$#" != "0" ]; do
echo "unknown flag $arg"
exit 1
fi
new="$rev"
new_name="$arg"
if git-show-ref --verify --quiet -- "refs/heads/$arg"
then
rev=$(git-rev-parse --verify "refs/heads/$arg^0")
branch="$arg"
fi
new="$rev"
elif rev=$(git-rev-parse --verify "$arg^{tree}" 2>/dev/null)
then
# checking out selected paths from a tree-ish.