Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
ruby-build
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ruby-build
Commits
8c3ad3c3
Commit
8c3ad3c3
authored
Jun 07, 2014
by
Mislav Marohnić
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #549 from yyuu/fix-fetch-git-with-keep
Fix `fetch_git` with `--keep`
parents
9b7679ad
07ef88d7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
1 deletions
+46
-1
bin/ruby-build
+8
-1
test/fetch.bats
+38
-0
No files found.
bin/ruby-build
View file @
8c3ad3c3
...
@@ -367,7 +367,14 @@ fetch_git() {
...
@@ -367,7 +367,14 @@ fetch_git() {
popd
>
&4
popd
>
&4
fi
fi
git clone
--depth
1
--branch
"
$git_ref
"
"
$git_url
"
"
${
package_name
}
"
>
&4 2>&1
if
[
-e
"
${
package_name
}
"
]
;
then
(
cd
"
${
package_name
}
"
git fetch
--depth
1 origin
"+
${
git_ref
}
"
git checkout
-q
-B
"
$git_ref
"
"origin/
${
git_ref
}
"
)
>
&4 2>&1
else
git clone
--depth
1
--branch
"
$git_ref
"
"
$git_url
"
"
${
package_name
}
"
>
&4 2>&1
fi
else
else
echo
"error: please install
\`
git
\`
and try again"
>
&2
echo
"error: please install
\`
git
\`
and try again"
>
&2
exit
1
exit
1
...
...
test/fetch.bats
View file @
8c3ad3c3
...
@@ -4,6 +4,11 @@ load test_helper
...
@@ -4,6 +4,11 @@ load test_helper
export RUBY_BUILD_SKIP_MIRROR=1
export RUBY_BUILD_SKIP_MIRROR=1
export RUBY_BUILD_CACHE_PATH=
export RUBY_BUILD_CACHE_PATH=
setup() {
export RUBY_BUILD_BUILD_PATH="${TMP}/source"
mkdir -p "${RUBY_BUILD_BUILD_PATH}"
}
@test "failed download displays error message" {
@test "failed download displays error message" {
stub curl false
stub curl false
...
@@ -12,3 +17,36 @@ export RUBY_BUILD_CACHE_PATH=
...
@@ -12,3 +17,36 @@ export RUBY_BUILD_CACHE_PATH=
assert_output_contains "> http://example.com/packages/package-1.0.0.tar.gz"
assert_output_contains "> http://example.com/packages/package-1.0.0.tar.gz"
assert_output_contains "error: failed to download package-1.0.0.tar.gz"
assert_output_contains "error: failed to download package-1.0.0.tar.gz"
}
}
@test "fetching from git repository" {
stub git "clone --depth 1 --branch master http://example.com/packages/package.git package-dev : mkdir package-dev"
run_inline_definition <<DEF
install_git "package-dev" "http://example.com/packages/package.git" master copy
DEF
assert_success
assert_output <<OUT
Cloning http://example.com/packages/package.git...
Installing package-dev...
Installed package-dev to ${TMP}/install
OUT
unstub git
}
@test "updating existing git repository" {
mkdir -p "${RUBY_BUILD_BUILD_PATH}/package-dev"
stub git \
"fetch --depth 1 origin +master : true" \
"checkout -q -B master origin/master : true"
run_inline_definition <<DEF
install_git "package-dev" "http://example.com/packages/package.git" master copy
DEF
assert_success
assert_output <<OUT
Cloning http://example.com/packages/package.git...
Installing package-dev...
Installed package-dev to ${TMP}/install
OUT
unstub git
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment