Class: Gitlab::LegacyGithubImport::BranchFormatter
Instance Attribute Summary
#client, #formatter, #project, #raw_data, #source_user_mapper
Instance Method Summary
collapse
#contributing_user_formatters, #create!, #create_record, #imported_from, #initialize, #push_placeholder_reference, #push_placeholder_references, #url
Instance Method Details
#exists? ⇒ Boolean
18
19
20
|
# File 'lib/gitlab/legacy_github_import/branch_formatter.rb', line 18
def exists?
branch_exists? && commit_exists?
end
|
#ref ⇒ Object
14
15
16
|
# File 'lib/gitlab/legacy_github_import/branch_formatter.rb', line 14
def ref
raw_data[:ref]
end
|
#repo ⇒ Object
6
7
8
|
# File 'lib/gitlab/legacy_github_import/branch_formatter.rb', line 6
def repo
raw_data[:repo]
end
|
#sha ⇒ Object
10
11
12
|
# File 'lib/gitlab/legacy_github_import/branch_formatter.rb', line 10
def sha
raw_data[:sha]
end
|
#short_sha ⇒ Object
30
31
32
|
# File 'lib/gitlab/legacy_github_import/branch_formatter.rb', line 30
def short_sha
Commit.truncate_sha(sha)
end
|
#user ⇒ Object
26
27
28
|
# File 'lib/gitlab/legacy_github_import/branch_formatter.rb', line 26
def user
raw_data.dig(:user, :login) || 'unknown'
end
|
#valid? ⇒ Boolean
22
23
24
|
# File 'lib/gitlab/legacy_github_import/branch_formatter.rb', line 22
def valid?
sha.present? && ref.present?
end
|