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
ddc4e656
Commit
ddc4e656
authored
Oct 24, 2014
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #8159 from cirosantilli/fix-rake-import-existing-group
Fix import.rake failed import if project name is also an existing namespace.
parents
8157c6b8
706b6b5a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
10 deletions
+2
-10
import.rake
lib/tasks/gitlab/import.rake
+2
-10
No files found.
lib/tasks/gitlab/import.rake
View file @
ddc4e656
...
@@ -15,8 +15,6 @@ namespace :gitlab do
...
@@ -15,8 +15,6 @@ namespace :gitlab do
git_base_path
=
Gitlab
.
config
.
gitlab_shell
.
repos_path
git_base_path
=
Gitlab
.
config
.
gitlab_shell
.
repos_path
repos_to_import
=
Dir
.
glob
(
git_base_path
+
'/**/*.git'
)
repos_to_import
=
Dir
.
glob
(
git_base_path
+
'/**/*.git'
)
namespaces
=
Namespace
.
pluck
(
:path
)
repos_to_import
.
each
do
|
repo_path
|
repos_to_import
.
each
do
|
repo_path
|
# strip repo base path
# strip repo base path
repo_path
[
0
..
git_base_path
.
length
]
=
''
repo_path
[
0
..
git_base_path
.
length
]
=
''
...
@@ -26,12 +24,6 @@ namespace :gitlab do
...
@@ -26,12 +24,6 @@ namespace :gitlab do
group_name
=
File
.
dirname
path
group_name
=
File
.
dirname
path
group_name
=
nil
if
group_name
==
'.'
group_name
=
nil
if
group_name
==
'.'
# Skip if group or user
if
namespaces
.
include?
(
name
)
puts
"Skipping
#{
project
.
name
}
due to namespace conflict with group or user"
.
yellow
next
end
puts
"Processing
#{
repo_path
}
"
.
yellow
puts
"Processing
#{
repo_path
}
"
.
yellow
if
path
=~
/\.wiki\Z/
if
path
=~
/\.wiki\Z/
...
@@ -53,9 +45,9 @@ namespace :gitlab do
...
@@ -53,9 +45,9 @@ namespace :gitlab do
# find group namespace
# find group namespace
if
group_name
if
group_name
group
=
Group
.
find_by
(
path:
group_name
)
group
=
Namespace
.
find_by
(
path:
group_name
)
# create group namespace
# create group namespace
if
!
group
unless
group
group
=
Group
.
new
(
:name
=>
group_name
)
group
=
Group
.
new
(
:name
=>
group_name
)
group
.
path
=
group_name
group
.
path
=
group_name
group
.
owner
=
user
group
.
owner
=
user
...
...
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