Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
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
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
968104b0
Commit
968104b0
authored
Mar 16, 2017
by
Tiago Botelho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adds timeout option to push mirrors
parent
59828154
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
4 deletions
+40
-4
GITLAB_SHELL_VERSION
GITLAB_SHELL_VERSION
+1
-1
changelogs/unreleased-ee/1907-add-timeout-to-push-mirrors.yml
...gelogs/unreleased-ee/1907-add-timeout-to-push-mirrors.yml
+4
-0
lib/gitlab/shell.rb
lib/gitlab/shell.rb
+1
-1
spec/lib/gitlab/backend/shell_spec.rb
spec/lib/gitlab/backend/shell_spec.rb
+34
-2
No files found.
GITLAB_SHELL_VERSION
View file @
968104b0
5.0.
0
5.0.
2
changelogs/unreleased-ee/1907-add-timeout-to-push-mirrors.yml
0 → 100644
View file @
968104b0
---
title
:
Adds timeout option to push mirrors
merge_request
:
1439
author
:
lib/gitlab/shell.rb
View file @
968104b0
...
...
@@ -307,7 +307,7 @@ module Gitlab
# push_remote_branches('upstream', 'feature')
#
def
push_remote_branches
(
storage
,
project_name
,
remote_name
,
branch_names
)
args
=
[
gitlab_shell_projects_path
,
'push-branches'
,
storage
,
"
#{
project_name
}
.git"
,
remote_name
,
*
branch_names
]
args
=
[
gitlab_shell_projects_path
,
'push-branches'
,
storage
,
"
#{
project_name
}
.git"
,
remote_name
,
'600'
,
*
branch_names
]
output
,
status
=
Popen
.
popen
(
args
)
raise
Error
,
output
unless
status
.
zero?
true
...
...
spec/lib/gitlab/backend/shell_spec.rb
View file @
968104b0
...
...
@@ -54,7 +54,7 @@ describe Gitlab::Shell, lib: true do
allow
(
Gitlab
.
config
.
gitlab_shell
).
to
receive
(
:path
).
and_return
(
'tmp/tests/shell-projects-test'
)
end
describe
'mv_repository'
do
describe
'
#
mv_repository'
do
it
'executes the command'
do
expect
(
Gitlab
::
Utils
).
to
receive
(
:system_silent
)
.
with
([
projects_path
,
'mv-project'
,
'storage/path'
,
'project/path.git'
,
'new/path.git'
])
...
...
@@ -62,13 +62,45 @@ describe Gitlab::Shell, lib: true do
end
end
describe
'mv_storage'
do
describe
'
#
mv_storage'
do
it
'executes the command'
do
expect
(
Gitlab
::
Utils
).
to
receive
(
:system_silent
)
.
with
([
projects_path
,
'mv-storage'
,
'current/storage'
,
'project/path.git'
,
'new/storage'
])
gitlab_shell
.
mv_storage
(
'current/storage'
,
'project/path'
,
'new/storage'
)
end
end
describe
'#fetch_remote'
do
it
'executes the command'
do
expect
(
Gitlab
::
Popen
).
to
receive
(
:popen
)
.
with
([
projects_path
,
'fetch-remote'
,
'current/storage'
,
'project/path.git'
,
'new/storage'
,
'600'
]).
and_return
([
nil
,
0
])
expect
(
gitlab_shell
.
fetch_remote
(
'current/storage'
,
'project/path'
,
'new/storage'
)).
to
be
true
end
it
'fails to execute the command'
do
expect
(
Gitlab
::
Popen
).
to
receive
(
:popen
)
.
with
([
projects_path
,
'fetch-remote'
,
'current/storage'
,
'project/path.git'
,
'new/storage'
,
'600'
]).
and_return
([
"error"
,
1
])
expect
{
gitlab_shell
.
fetch_remote
(
'current/storage'
,
'project/path'
,
'new/storage'
)
}.
to
raise_error
(
Gitlab
::
Shell
::
Error
,
"error"
)
end
end
describe
'#push_remote_branches'
do
it
'executes the command'
do
expect
(
Gitlab
::
Popen
).
to
receive
(
:popen
)
.
with
([
projects_path
,
'push-branches'
,
'current/storage'
,
'project/path.git'
,
'new/storage'
,
'600'
,
'master'
]).
and_return
([
nil
,
0
])
expect
(
gitlab_shell
.
push_remote_branches
(
'current/storage'
,
'project/path'
,
'new/storage'
,
[
'master'
])).
to
be
true
end
it
'fails to execute the command'
do
expect
(
Gitlab
::
Popen
).
to
receive
(
:popen
)
.
with
([
projects_path
,
'push-branches'
,
'current/storage'
,
'project/path.git'
,
'new/storage'
,
'600'
,
'master'
]).
and_return
([
"error"
,
1
])
expect
{
gitlab_shell
.
push_remote_branches
(
'current/storage'
,
'project/path'
,
'new/storage'
,
[
'master'
])
}.
to
raise_error
(
Gitlab
::
Shell
::
Error
,
"error"
)
end
end
end
describe
'#add_key'
do
...
...
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