Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-shell
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
Kazuhiko Shiozaki
gitlab-shell
Commits
01a74127
Commit
01a74127
authored
Mar 13, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dont import repo if exists
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
0f4ad24f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
+12
-0
lib/gitlab_projects.rb
lib/gitlab_projects.rb
+3
-0
spec/gitlab_projects_spec.rb
spec/gitlab_projects_spec.rb
+9
-0
No files found.
lib/gitlab_projects.rb
View file @
01a74127
...
@@ -92,6 +92,9 @@ class GitlabProjects
...
@@ -92,6 +92,9 @@ class GitlabProjects
# Import project via git clone --bare
# Import project via git clone --bare
# URL must be publicly cloneable
# URL must be publicly cloneable
def
import_project
def
import_project
# Skip import if repo already exists
return
false
if
File
.
exists?
(
full_path
)
@source
=
ARGV
.
shift
@source
=
ARGV
.
shift
# timeout for clone
# timeout for clone
...
...
spec/gitlab_projects_spec.rb
View file @
01a74127
...
@@ -213,6 +213,15 @@ describe GitlabProjects do
...
@@ -213,6 +213,15 @@ describe GitlabProjects do
end
end
end
end
context
'already exists'
do
let
(
:gl_projects
)
{
build_gitlab_projects
(
'import-project'
,
repo_name
,
'https://github.com/randx/six.git'
)
}
it
'should import only once'
do
gl_projects
.
exec
.
should
be_true
gl_projects
.
exec
.
should
be_false
end
end
context
'timeout'
do
context
'timeout'
do
let
(
:gl_projects
)
{
build_gitlab_projects
(
'import-project'
,
repo_name
,
'https://github.com/gitlabhq/gitlabhq.git'
,
'1'
)
}
let
(
:gl_projects
)
{
build_gitlab_projects
(
'import-project'
,
repo_name
,
'https://github.com/gitlabhq/gitlabhq.git'
,
'1'
)
}
...
...
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