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
Boxiang Sun
gitlab-ce
Commits
3aee167d
Commit
3aee167d
authored
May 09, 2016
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed issues after refactor, spec passing
parent
8ac53eb5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
lib/gitlab/import_export/import_export_reader.rb
lib/gitlab/import_export/import_export_reader.rb
+5
-5
spec/lib/gitlab/import_export/import_export_reader_spec.rb
spec/lib/gitlab/import_export/import_export_reader_spec.rb
+1
-1
No files found.
lib/gitlab/import_export/import_export_reader.rb
View file @
3aee167d
...
@@ -4,14 +4,14 @@ module Gitlab
...
@@ -4,14 +4,14 @@ module Gitlab
#FIXME
#FIXME
def
initialize
(
config:
'lib/gitlab/import_export/import_export.yml'
)
def
initialize
(
config:
'lib/gitlab/import_export/import_export.yml'
)
config
=
YAML
.
load_file
(
'lib/gitlab/import_export/import_export.yml'
).
with_indifferent_access
config
_hash
=
YAML
.
load_file
(
config
).
with_indifferent_access
@tree
=
config
[
:project_tree
]
@tree
=
config
_hash
[
:project_tree
]
@attributes_parser
=
Gitlab
::
ImportExport
::
AttributesFinder
.
new
(
included_attributes:
config
[
:included_attributes
],
@attributes_parser
=
Gitlab
::
ImportExport
::
AttributesFinder
.
new
(
included_attributes:
config
_hash
[
:included_attributes
],
excluded_attributes:
config
[
:excluded_attributes
])
excluded_attributes:
config
_hash
[
:excluded_attributes
])
end
end
def
project_tree
def
project_tree
{
only:
@attributes_parser
.
find_included
(
:project
),
include:
build_hash
(
@tree
)
}
@attributes_parser
.
find_included
(
:project
).
merge
(
include:
build_hash
(
@tree
))
end
end
private
private
...
...
spec/lib/gitlab/import_export/import_export_reader_spec.rb
View file @
3aee167d
...
@@ -17,6 +17,6 @@ describe Gitlab::ImportExport::ImportExportReader do
...
@@ -17,6 +17,6 @@ describe Gitlab::ImportExport::ImportExportReader do
end
end
it
'should generate hash from project tree config'
do
it
'should generate hash from project tree config'
do
expect
(
described_class
.
new
(
config:
test_config
).
project_tree
)
.
to
eq
(
project_tree_hash
)
expect
(
described_class
.
new
(
config:
test_config
).
project_tree
)
=~
(
project_tree_hash
)
end
end
end
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