Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
089bb6ac
Unverified
Commit
089bb6ac
authored
Dec 21, 2019
by
Yukihiro "Matz" Matsumoto
Committed by
GitHub
Dec 21, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4888 from dearblue/shellquote
Perform `shellquote` on referenced string
parents
06e09fc7
acef52c3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
lib/mruby/build/command.rb
lib/mruby/build/command.rb
+7
-7
No files found.
lib/mruby/build/command.rb
View file @
089bb6ac
...
...
@@ -286,29 +286,29 @@ module MRuby
@command
=
'git'
@flags
=
%w[]
@clone_options
=
"clone %{flags} %{url} %{dir}"
@pull_options
=
"--git-dir
#{
shellquote
(
"%{repo_dir}/.git"
)
}
--work-tree
#{
shellquote
(
"%{repo_dir}"
)
}
pull"
@checkout_options
=
"--git-dir
#{
shellquote
(
"%{repo_dir}/.git"
)
}
--work-tree
#{
shellquote
(
"%{repo_dir}"
)
}
checkout %{checksum_hash}"
@reset_options
=
"--git-dir
#{
shellquote
(
"%{repo_dir}/.git"
)
}
--work-tree
#{
shellquote
(
"%{repo_dir}"
)
}
reset %{checksum_hash}"
@pull_options
=
"--git-dir
%{repo_dir}/.git --work-tree %{repo_dir
} pull"
@checkout_options
=
"--git-dir
%{repo_dir}/.git --work-tree %{repo_dir
} checkout %{checksum_hash}"
@reset_options
=
"--git-dir
%{repo_dir}/.git --work-tree %{repo_dir
} reset %{checksum_hash}"
end
def
run_clone
(
dir
,
url
,
_flags
=
[])
_pp
"GIT"
,
url
,
dir
.
relative_path
_run
clone_options
,
{
:flags
=>
[
flags
,
_flags
].
flatten
.
join
(
' '
),
:url
=>
url
,
:dir
=>
filename
(
dir
)
}
_run
clone_options
,
{
:flags
=>
[
flags
,
_flags
].
flatten
.
join
(
' '
),
:url
=>
shellquote
(
url
),
:dir
=>
shellquote
(
filename
(
dir
)
)
}
end
def
run_pull
(
dir
,
url
)
_pp
"GIT PULL"
,
url
,
dir
.
relative_path
_run
pull_options
,
{
:repo_dir
=>
dir
}
_run
pull_options
,
{
:repo_dir
=>
shellquote
(
dir
)
}
end
def
run_checkout
(
dir
,
checksum_hash
)
_pp
"GIT CHECKOUT"
,
checksum_hash
_run
checkout_options
,
{
:checksum_hash
=>
checksum_hash
,
:repo_dir
=>
dir
}
_run
checkout_options
,
{
:checksum_hash
=>
checksum_hash
,
:repo_dir
=>
shellquote
(
dir
)
}
end
def
run_reset_hard
(
dir
,
checksum_hash
)
_pp
"GIT RESET"
,
checksum_hash
_run
reset_options
,
{
:checksum_hash
=>
checksum_hash
,
:repo_dir
=>
dir
}
_run
reset_options
,
{
:checksum_hash
=>
checksum_hash
,
:repo_dir
=>
shellquote
(
dir
)
}
end
def
commit_hash
(
dir
)
...
...
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