1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

git-refresh: fix expr

* tool/git-refresh (dir): surround by slashes to extract base
  name.  [ruby-dev:50070] [Bug #13424]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58335 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2017-04-13 07:52:05 +00:00
parent 38174633e2
commit e1557424b3

View file

@ -24,13 +24,13 @@ url="$1"
dir="$2"
shift 2
if [ -d "$dir" ]; then
echo updating `expr "$dir" : '*/\(.*\)'` ...
echo updating `expr "/$dir/" : '.*/\([^/][^/]*\)/'` ...
[ $quiet ] || set -x
cd "$dir"
git fetch "$@"
exec git checkout ${branch:+"$branch"} "$@"
else
echo retrieving `expr "$dir" : '*/\(.*\)'` ...
echo retrieving `expr "/$dir/" : '.*/\([^/][^/]*\)/'` ...
[ $quiet ] || set -x
exec git clone "$url" "$dir" "$@"
fi