-update_repo()
-{
- if [ ${#} -ne 1 ]; then
- echo "Missing repository name"
- exit 1
- fi
-
- local r=${1}
-
- echo "Repo ${r}:"
-
- pushd "${r}" 1> /dev/null
- b=${branch}
- exists=$(git show-ref refs/heads/${b})
-
- if [ -n "$exists" ]; then
- [ -n "${debug}" ] && echo "branch <${b}> exists"
- vco ${b} 1> /dev/null
- else
- echo "Branch <${b}> not found, trying <latest>"
- b=latest
- exists=$(git show-ref refs/heads/${b})
- if [ -n "$exists" ]; then
- [ -n "${debug}" ] && echo "branch <${b}> exists"
- vco ${b} 1> /dev/null
- else
- echo "Branch <${b}> not found, defaulting to <master>"
- b=master
- exists=$(git show-ref refs/heads/${b})
- if [ -n "$exists" ]; then
- [ -n "${debug}" ] && echo "branch <${b}> exists"
- vco ${b} 1> /dev/null
- else
- echo "Error swtiching to branch <${b}>"
- exit 1
- fi
- fi
- fi
- popd 1> /dev/null
-}
-
-update_repo ./
-
-# Read list of repositories from file named .gitsubrepos
-while IFS=$'\n' read r ; do
- [[ "${r}" =~ \#.* ]] && continue # Skip comment lines
- [ -z ${r} ] && continue # Skip enmpty lines
-