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
7ee9c3c4
Commit
7ee9c3c4
authored
Jul 26, 2018
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use project key instead of project name for imports
parent
e52f6bf5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
1 deletion
+9
-1
app/views/import/bitbucket_server/status.html.haml
app/views/import/bitbucket_server/status.html.haml
+1
-1
lib/bitbucket_server/representation/repo.rb
lib/bitbucket_server/representation/repo.rb
+4
-0
spec/lib/bitbucket_server/representation/repo_spec.rb
spec/lib/bitbucket_server/representation/repo_spec.rb
+4
-0
No files found.
app/views/import/bitbucket_server/status.html.haml
View file @
7ee9c3c4
...
...
@@ -50,7 +50,7 @@
=
project
.
human_import_status_name
-
@repos
.
each
do
|
repo
|
%tr
{
id:
"repo_#{repo.owner}___#{repo.slug}"
,
data:
{
project:
repo
.
project_
name
,
repository:
repo
.
slug
}
}
%tr
{
id:
"repo_#{repo.owner}___#{repo.slug}"
,
data:
{
project:
repo
.
project_
key
,
repository:
repo
.
slug
}
}
%td
=
link_to
repo
.
browse_url
,
repo
.
browse_url
,
target:
'_blank'
,
rel:
'noopener noreferrer'
%td
.import-target
...
...
lib/bitbucket_server/representation/repo.rb
View file @
7ee9c3c4
...
...
@@ -7,6 +7,10 @@ module BitbucketServer
super
(
raw
)
end
def
project_key
raw
.
dig
(
'project'
,
'key'
)
end
def
project_name
raw
.
dig
(
'project'
,
'name'
)
end
...
...
spec/lib/bitbucket_server/representation/repo_spec.rb
View file @
7ee9c3c4
...
...
@@ -50,6 +50,10 @@ describe BitbucketServer::Representation::Repo do
subject
{
described_class
.
new
(
JSON
.
parse
(
sample_data
))
}
describe
'#project_key'
do
it
{
expect
(
subject
.
project_key
).
to
eq
(
'TEST'
)
}
end
describe
'#project_name'
do
it
{
expect
(
subject
.
project_name
).
to
eq
(
'test'
)
}
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