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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
f87e702e
Commit
f87e702e
authored
Jun 20, 2018
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CE-EE parity for lib/gitlab/git/gitlab_projects.rb
parent
a8f4f48e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
12 deletions
+13
-12
lib/gitlab/git/gitlab_projects.rb
lib/gitlab/git/gitlab_projects.rb
+13
-12
No files found.
lib/gitlab/git/gitlab_projects.rb
View file @
f87e702e
...
...
@@ -61,22 +61,15 @@ module Gitlab
end
def
fetch_remote
(
name
,
timeout
,
force
:,
tags
:,
ssh_key:
nil
,
known_hosts:
nil
,
prune:
true
)
tags_option
=
tags
?
'--tags'
:
'--no-tags'
logger
.
info
"Fetching remote
#{
name
}
for repository
#{
repository_absolute_path
}
."
cmd
=
%W(
#{
Gitlab
.
config
.
git
.
bin_path
}
fetch
#{
name
}
--quiet)
cmd
<<
'--prune'
if
prune
cmd
<<
'--force'
if
force
cmd
<<
tags_option
cmd
=
fetch_remote_command
(
name
,
tags
,
prune
,
force
)
setup_ssh_auth
(
ssh_key
,
known_hosts
)
do
|
env
|
success
=
run_with_timeout
(
cmd
,
timeout
,
repository_absolute_path
,
env
)
run_with_timeout
(
cmd
,
timeout
,
repository_absolute_path
,
env
).
tap
do
|
success
|
unless
success
logger
.
error
"Fetching remote
#{
name
}
for repository
#{
repository_absolute_path
}
failed."
end
success
end
end
end
...
...
@@ -202,6 +195,14 @@ module Gitlab
private
def
fetch_remote_command
(
name
,
tags
,
prune
,
force
)
%W(
#{
Gitlab
.
config
.
git
.
bin_path
}
fetch
#{
name
}
--quiet)
.
tap
do
|
cmd
|
cmd
<<
'--prune'
if
prune
cmd
<<
'--force'
if
force
cmd
<<
(
tags
?
'--tags'
:
'--no-tags'
)
end
end
def
git_import_repository
(
source
,
timeout
)
# Skip import if repo already exists
return
false
if
File
.
exist?
(
repository_absolute_path
)
...
...
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