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
07ef88d7
Commit
07ef88d7
authored
Apr 17, 2014
by
Yamashita Yuu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Surely update local git working copy
parent
28dcc3f8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
5 deletions
+13
-5
bin/ruby-build
+4
-3
test/fetch.bats
+9
-2
No files found.
bin/ruby-build
View file @
07ef88d7
...
@@ -357,9 +357,9 @@ fetch_git() {
...
@@ -357,9 +357,9 @@ fetch_git() {
pushd
"
$RUBY_BUILD_CACHE_PATH
"
>
&4
pushd
"
$RUBY_BUILD_CACHE_PATH
"
>
&4
local
clone_name
=
"
$(
sanitize
"
$git_url
"
)
"
local
clone_name
=
"
$(
sanitize
"
$git_url
"
)
"
if
[
-e
"
${
clone_name
}
"
]
;
then
if
[
-e
"
${
clone_name
}
"
]
;
then
(
cd
"
${
clone_name
}
"
{
cd
"
${
clone_name
}
"
git fetch
--force
"
$git_url
"
"+
${
git_ref
}
:
${
git_ref
}
"
git fetch
--force
"
$git_url
"
"+
${
git_ref
}
:
${
git_ref
}
"
)
>
&4 2>&1
}
>
&4 2>&1
else
else
git clone
--bare
--branch
"
$git_ref
"
"
$git_url
"
"
${
clone_name
}
"
>
&4 2>&1
git clone
--bare
--branch
"
$git_ref
"
"
$git_url
"
"
${
clone_name
}
"
>
&4 2>&1
fi
fi
...
@@ -369,7 +369,8 @@ fetch_git() {
...
@@ -369,7 +369,8 @@ fetch_git() {
if
[
-e
"
${
package_name
}
"
]
;
then
if
[
-e
"
${
package_name
}
"
]
;
then
(
cd
"
${
package_name
}
"
(
cd
"
${
package_name
}
"
git fetch
--force
--update-head-ok
"
$git_url
"
"+
${
git_ref
}
:
${
git_ref
}
"
git fetch
--depth
1 origin
"+
${
git_ref
}
"
git checkout
-q
-B
"
$git_ref
"
"origin/
${
git_ref
}
"
)
>
&4 2>&1
)
>
&4 2>&1
else
else
git clone
--depth
1
--branch
"
$git_ref
"
"
$git_url
"
"
${
package_name
}
"
>
&4 2>&1
git clone
--depth
1
--branch
"
$git_ref
"
"
$git_url
"
"
${
package_name
}
"
>
&4 2>&1
...
...
test/fetch.bats
View file @
07ef88d7
...
@@ -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
...
@@ -29,10 +34,12 @@ OUT
...
@@ -29,10 +34,12 @@ OUT
}
}
@test "updating existing git repository" {
@test "updating existing git repository" {
stub git "fetch --force --update-head-ok http://example.com/packages/package.git +master:master : true"
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
run_inline_definition <<DEF
mkdir "\${BUILD_PATH}/package-dev"
install_git "package-dev" "http://example.com/packages/package.git" master copy
install_git "package-dev" "http://example.com/packages/package.git" master copy
DEF
DEF
assert_success
assert_success
...
...
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