Make `GIT_REMOTES` array instead of converting it
from a string to array.
cdgitpath remote.$remote.url
else
cdgitpath remote.$remote.url
else
- local GIT_REMOTES remote
- GIT_REMOTES=""
+ local remote
+ local -a GIT_REMOTES=()
for remote in `git remote`; do
if git config --get remote.$remote.url | grep -q '^\(/\|\.\./\)'; then
for remote in `git remote`; do
if git config --get remote.$remote.url | grep -q '^\(/\|\.\./\)'; then
- GIT_REMOTES="$GIT_REMOTES $remote"
- GIT_REMOTES=($GIT_REMOTES)
if [ ${#GIT_REMOTES[*]} -eq 1 ]; then
remote=${GIT_REMOTES[0]}
cdgitpath remote.$remote.url
if [ ${#GIT_REMOTES[*]} -eq 1 ]; then
remote=${GIT_REMOTES[0]}
cdgitpath remote.$remote.url
echo "Usage: _list_remotes remote_regexp" >&2
return 1
fi
echo "Usage: _list_remotes remote_regexp" >&2
return 1
fi
+ declare -ag GIT_REMOTES=()
local remote
for remote in `git remote`; do
if git config --get remote.$remote.url | grep -q "$1"; then
local remote
for remote in `git remote`; do
if git config --get remote.$remote.url | grep -q "$1"; then
- GIT_REMOTES="$GIT_REMOTES $remote"