Better logic for change_to_vcs_root
This commit is contained in:
@@ -295,17 +295,13 @@ function enumerate_subdirs() {
|
|||||||
# chdir to the base of the repo.
|
# chdir to the base of the repo.
|
||||||
function change_to_vcs_root() {
|
function change_to_vcs_root() {
|
||||||
# if vcs_root not explicitly defined, use $REPOBASE
|
# if vcs_root not explicitly defined, use $REPOBASE
|
||||||
if [[ -z "$1" ]]; then
|
|
||||||
cd "$REPOBASE"
|
|
||||||
|
|
||||||
elif is_blackbox_repo "$1"; then
|
local rbase=${1:-$REPOBASE} # use $1 but if unset use $REPOBASE
|
||||||
cd "$1"
|
|
||||||
|
|
||||||
else
|
if ! is_blackbox_repo "$rbase"; then
|
||||||
echo 'ERROR: $1 is not a blackbox Repo'
|
echo "ERROR: $rbase is not a blackbox Repo"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# $1 is a string pointing to a directory. Outputs a
|
# $1 is a string pointing to a directory. Outputs a
|
||||||
|
|||||||
Reference in New Issue
Block a user