Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion test/helper/common.bash
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@ export GIT_TERMINAL_PROMPT=0

function git_checkout() {
local URL="$1"
local TARGET="$BATS_TMPDIR/workdir/${1##*/}"
# Transform URL into a filesystem path, stripping the protocol and replacing special characters with underscores
local LOCAL_PATH
LOCAL_PATH="$(printf '%s' "$URL" |
sed -E '
s#^[a-zA-Z]+://##;
s#[?&=:#]#_#g
')"
local TARGET="$BATS_TMPDIR/workdir/${LOCAL_PATH}"

echo "==> Checking out $URL to $TARGET"

Expand Down
Loading