Skip to content

Commit 0c9709b

Browse files
committed
Update function for clone_repo to accept optional argument
1 parent 62b74ff commit 0c9709b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

ci/script/functions.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,13 @@ fi
1616

1717
function clone_repo {
1818
if [ ! -d $1 ]; then # don't clone if the dir is already there
19-
travis_retry eval "git clone https://github.com/rspec/$1 --depth 1 --branch $MAINTENANCE_BRANCH"
19+
if [ -z "$2" ]; then
20+
BRANCH_TO_CLONE="$MAINTENANCE_BRANCH"
21+
else
22+
BRANCH_TO_CLONE="$2"
23+
fi
24+
25+
travis_retry eval "git clone https://github.com/rspec/$1 --depth 1 --branch $BRANCH_TO_CLONE"
2026
fi;
2127
}
2228

0 commit comments

Comments
 (0)