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
Tatuya Kamada
gitlab-ce
Commits
6e590af1
Commit
6e590af1
authored
Oct 19, 2016
by
Ahmad Sherif
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check if repository already exists before trying to re-import it
parent
66870960
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
app/services/projects/import_service.rb
app/services/projects/import_service.rb
+1
-1
spec/services/projects/import_service_spec.rb
spec/services/projects/import_service_spec.rb
+1
-1
No files found.
app/services/projects/import_service.rb
View file @
6e590af1
...
...
@@ -29,7 +29,7 @@ module Projects
if
unknown_url?
# In this case, we only want to import issues, not a repository.
create_repository
els
e
els
if
!
project
.
repository_exists?
import_repository
end
end
...
...
spec/services/projects/import_service_spec.rb
View file @
6e590af1
...
...
@@ -110,7 +110,7 @@ describe Projects::ImportService, services: true do
end
it
'expires existence cache after error'
do
allow_any_instance_of
(
Project
).
to
receive
(
:repository_exists?
).
and_return
(
true
)
allow_any_instance_of
(
Project
).
to
receive
(
:repository_exists?
).
and_return
(
false
,
true
)
expect_any_instance_of
(
Gitlab
::
Shell
).
to
receive
(
:import_repository
).
with
(
project
.
repository_storage_path
,
project
.
path_with_namespace
,
project
.
import_url
).
and_raise
(
Gitlab
::
Shell
::
Error
.
new
(
'Failed to import the repository'
))
expect_any_instance_of
(
Repository
).
to
receive
(
:expire_emptiness_caches
).
and_call_original
...
...
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