Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
884405d2a9e6
Commit
e8a99439
authored
Feb 06, 2018
by
Douwe Maan
Browse files
Only set cwd on the newly spawned process, instead of the current one
parent
4a691e66862c
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/gitlab/git/hook.rb
View file @
884405d2
...
...
@@ -82,14 +82,20 @@ def call_receive_hook(gl_id, gl_username, oldrev, newrev, ref)
end
def
call_update_hook
(
gl_id
,
gl_username
,
oldrev
,
newrev
,
ref
)
Dir
.
chdir
(
repo_path
)
do
env
=
{
'GL_ID'
=>
gl_id
,
'GL_USERNAME'
=>
gl_username
}
stdout
,
stderr
,
status
=
Open3
.
capture3
(
env
,
path
,
ref
,
oldrev
,
newrev
)
[
status
.
success?
,
(
stderr
.
presence
||
stdout
).
gsub
(
/\R/
,
"<br>"
).
html_safe
]
end
env
=
{
'GL_ID'
=>
gl_id
,
'GL_USERNAME'
=>
gl_username
,
'PWD'
=>
repo_path
}
options
=
{
chdir:
repo_path
}
args
=
[
ref
,
oldrev
,
newrev
]
stdout
,
stderr
,
status
=
Open3
.
capture3
(
env
,
path
,
*
args
,
options
)
[
status
.
success?
,
(
stderr
.
presence
||
stdout
).
gsub
(
/\R/
,
"<br>"
).
html_safe
]
end
def
retrieve_error_message
(
stderr
,
stdout
)
...
...
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