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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
3c75ee28
Commit
3c75ee28
authored
Mar 26, 2017
by
Gabriel Mazetto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor refactor
parent
c8273ba8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
12 deletions
+7
-12
lib/gitlab/github_import/branch_formatter.rb
lib/gitlab/github_import/branch_formatter.rb
+2
-2
lib/gitlab/github_import/pull_request_formatter.rb
lib/gitlab/github_import/pull_request_formatter.rb
+5
-10
No files found.
lib/gitlab/github_import/branch_formatter.rb
View file @
3c75ee28
...
...
@@ -15,8 +15,8 @@ module Gitlab
raw_data
.
user
&
.
login
||
'unknown'
end
def
short_sha
(
length
=
7
)
sha
.
to_s
[
0
..
length
]
def
short_sha
Commit
.
truncate_sha
(
sha
)
end
private
...
...
lib/gitlab/github_import/pull_request_formatter.rb
View file @
3c75ee28
...
...
@@ -37,13 +37,12 @@ module Gitlab
end
def
source_branch_name
@source_branch_name
||=
begin
if
cross_project?
@source_branch_name
||=
if
cross_project?
||
!
source_branch_exists?
source_branch_name_prefixed
else
source_branch_
exists?
?
source_branch_ref
:
source_branch_name_prefixed
source_branch_
ref
end
end
end
def
source_branch_name_prefixed
...
...
@@ -51,9 +50,7 @@ module Gitlab
end
def
source_branch_exists?
return
false
if
cross_project?
source_branch
.
exists?
!
cross_project?
&&
source_branch
.
exists?
end
def
target_branch
...
...
@@ -61,9 +58,7 @@ module Gitlab
end
def
target_branch_name
@target_branch_name
||=
begin
target_branch_exists?
?
target_branch_ref
:
target_branch_name_prefixed
end
@target_branch_name
||=
target_branch_exists?
?
target_branch_ref
:
target_branch_name_prefixed
end
def
target_branch_name_prefixed
...
...
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