BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
d4058995
Commit
d4058995
authored
Apr 07, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix rake test to import Github repositories
parent
fd16c892
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
import.rake
lib/tasks/import.rake
+9
-2
No files found.
lib/tasks/import.rake
View file @
d4058995
...
...
@@ -48,9 +48,16 @@ class NewImporter < ::Gitlab::GithubImport::Importer
begin
raise
'Blocked import URL.'
if
Gitlab
::
UrlBlocker
.
blocked_url?
(
project
.
import_url
)
gitlab_shell
.
import_repository
(
project
.
repository_storage_path
,
project
.
path_with_namespace
,
project
.
import_url
)
project
.
create_repository
project
.
repository
.
add_remote
(
project
.
import_type
,
project
.
import_url
)
project
.
repository
.
set_remote_as_mirror
(
project
.
import_type
)
project
.
repository
.
fetch_remote
(
project
.
import_type
,
forced:
true
)
project
.
repository
.
remove_remote
(
project
.
import_type
)
rescue
=>
e
project
.
repository
.
before_import
if
project
.
repository_exists?
# Expire cache to prevent scenarios such as:
# 1. First import failed, but the repo was imported successfully, so +exists?+ returns true
# 2. Retried import, repo is broken or not imported but +exists?+ still returns true
project
.
repository
.
expire_content_cache
if
project
.
repository_exists?
raise
"Error importing repository
#{
project
.
import_url
}
into
#{
project
.
path_with_namespace
}
-
#{
e
.
message
}
"
end
...
...
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