Skip to content

Commit

Permalink
Address some feedback from Jeremy
Browse files Browse the repository at this point in the history
* Decrease likelihood of cache collisions
* Avoid file:// urls (and therefore the need to escape)
  • Loading branch information
rubys authored and sstephenson committed Apr 19, 2013
1 parent 394d8aa commit 3064886
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bin/ruby-build
Original file line number Diff line number Diff line change
Expand Up @@ -294,15 +294,15 @@ fetch_git() {
if type git &>/dev/null; then
if [ -n "$RUBY_BUILD_CACHE_PATH" ]; then
pushd "$RUBY_BUILD_CACHE_PATH" >&4
local clone_name=$(echo $git_url | sed "s/[^a-z0-9.]/_/g; s/__*/_/g")
local clone_name=$(echo $git_url | sed "s/[^A-Za-z0-9.-]/_/g; s/__*/_/g")
if [ -e "${clone_name}" ]; then
{ cd "${clone_name}"
git fetch --force "$git_url" "+${git_ref}:${git_ref}"
} >&4 2>&1
else
git clone --bare --branch "$git_ref" "$git_url" "${clone_name}" >&4 2>&1
fi
git_url="file://$RUBY_BUILD_CACHE_PATH/${clone_name}"
git_url="$RUBY_BUILD_CACHE_PATH/${clone_name}"
popd >&4
fi

Expand Down

0 comments on commit 3064886

Please sign in to comment.