mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
git-refresh: for old sh
* tool/git-refresh: get rid of matching prefix pattern removal for old sh. [ruby-dev:50069] [Bug #13424] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58325 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
d9df358ea8
commit
f91985b34d
1 changed files with 6 additions and 6 deletions
|
@ -8,12 +8,12 @@ until [ $# = 0 ]; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
--) shift; break;;
|
--) shift; break;;
|
||||||
-C|--directory) shift; cd "$1";;
|
-C|--directory) shift; cd "$1";;
|
||||||
-C*) cd "${1#-C}";;
|
-C*) cd `expr "$1" : '-C\(.*\)'`;;
|
||||||
--directory=*) cd "${1#*=}";;
|
--directory=*) cd `expr "$1" : '[^=]*=\(.*\)'`;;
|
||||||
-q) quiet=1;;
|
-q) quiet=1;;
|
||||||
-b|--branch) shift; branch="$1";;
|
-b|--branch) shift; branch="$1";;
|
||||||
-b*) branch="${1#-b}";;
|
-b*) branch=`expr "$1" : '-b\(.*\)'`;;
|
||||||
--branch=*) branch="${1#*=}";;
|
--branch=*) branch=`expr "$1" : '[^=]*=\(.*\)'`;;
|
||||||
-*) echo "unknown option: $1" 1>&2; exit 1;;
|
-*) echo "unknown option: $1" 1>&2; exit 1;;
|
||||||
*) break;;
|
*) break;;
|
||||||
esac
|
esac
|
||||||
|
@ -24,13 +24,13 @@ url="$1"
|
||||||
dir="$2"
|
dir="$2"
|
||||||
shift 2
|
shift 2
|
||||||
if [ -d "$dir" ]; then
|
if [ -d "$dir" ]; then
|
||||||
echo updating "${dir#*/}" ...
|
echo updating `expr "$dir" : '*/\(.*\)'` ...
|
||||||
[ $quiet ] || set -x
|
[ $quiet ] || set -x
|
||||||
cd "$dir"
|
cd "$dir"
|
||||||
git fetch "$@"
|
git fetch "$@"
|
||||||
exec git checkout ${branch:+"$branch"} "$@"
|
exec git checkout ${branch:+"$branch"} "$@"
|
||||||
else
|
else
|
||||||
echo retrieving "${dir#*/}" ...
|
echo retrieving `expr "$dir" : '*/\(.*\)'` ...
|
||||||
[ $quiet ] || set -x
|
[ $quiet ] || set -x
|
||||||
exec git clone "$url" "$dir" "$@"
|
exec git clone "$url" "$dir" "$@"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue