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
Léo-Paul Géneau
gitlab-ce
Commits
e8cced80
Commit
e8cced80
authored
Dec 08, 2017
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix failing importer test case on MySQL due to missing trailing slash in root path
parent
78f7c3c8
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
1 deletion
+15
-1
lib/gitlab/bare_repository_import/repository.rb
lib/gitlab/bare_repository_import/repository.rb
+4
-1
spec/lib/gitlab/bare_repository_import/importer_spec.rb
spec/lib/gitlab/bare_repository_import/importer_spec.rb
+4
-0
spec/lib/gitlab/bare_repository_import/repository_spec.rb
spec/lib/gitlab/bare_repository_import/repository_spec.rb
+7
-0
No files found.
lib/gitlab/bare_repository_import/repository.rb
View file @
e8cced80
...
...
@@ -34,8 +34,11 @@ module Gitlab
private
def
repo_relative_path
absolute_path
=
Pathname
.
new
(
repo_path
)
project_root
=
Pathname
.
new
(
@root_path
)
# Remove root path and `.git` at the end
repo_path
[
@root_path
.
size
...-
4
]
absolute_path
.
relative_path_from
(
project_root
).
to_s
.
gsub
(
/\.git$/
,
''
)
end
end
end
...
...
spec/lib/gitlab/bare_repository_import/importer_spec.rb
View file @
e8cced80
...
...
@@ -134,8 +134,12 @@ describe Gitlab::BareRepositoryImport::Importer, repository: true do
end
it
'moves an existing project to the correct path'
do
# This is a quick way to get a valid repository instead of copying an existing one
project
=
create
(
:project
,
:repository
)
original_commit_count
=
project
.
repository
.
commit_count
# We need to destroy the model but keep the repository so that the
# importer will attempt to load the repository
project
.
destroy
bare_repo
=
Gitlab
::
BareRepositoryImport
::
Repository
.
new
(
project
.
repository_storage_path
,
project
.
repository
.
path
)
gitlab_importer
=
described_class
.
new
(
admin
,
bare_repo
)
...
...
spec/lib/gitlab/bare_repository_import/repository_spec.rb
View file @
e8cced80
...
...
@@ -46,6 +46,13 @@ describe ::Gitlab::BareRepositoryImport::Repository do
describe
'#project_full_path'
do
it
'returns the project full path'
do
expect
(
project_repo_path
.
repo_path
).
to
eq
(
'/full/path/to/repo.git'
)
expect
(
project_repo_path
.
project_full_path
).
to
eq
(
'to/repo'
)
end
it
'with no trailing slash in the root path'
do
repo_path
=
described_class
.
new
(
'/full/path'
,
'/full/path/to/repo.git'
)
expect
(
repo_path
.
project_full_path
).
to
eq
(
'to/repo'
)
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