BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
8ca040d8
Commit
8ca040d8
authored
Dec 01, 2016
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix branch validation for GitHub PR where repo/fork was renamed/deleted
parent
24e5a1e8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
+10
-4
branch_formatter.rb
lib/gitlab/github_import/branch_formatter.rb
+1
-1
branch_formatter_spec.rb
spec/lib/gitlab/github_import/branch_formatter_spec.rb
+9
-3
No files found.
lib/gitlab/github_import/branch_formatter.rb
View file @
8ca040d8
...
...
@@ -8,7 +8,7 @@ module Gitlab
end
def
valid?
repo
.
present?
sha
.
present?
&&
ref
.
present?
end
private
...
...
spec/lib/gitlab/github_import/branch_formatter_spec.rb
View file @
8ca040d8
...
...
@@ -49,14 +49,20 @@ describe Gitlab::GithubImport::BranchFormatter, lib: true do
end
describe
'#valid?'
do
it
'returns true when raw
repo is
present'
do
it
'returns true when raw
sha and ref are
present'
do
branch
=
described_class
.
new
(
project
,
double
(
raw
))
expect
(
branch
.
valid?
).
to
eq
true
end
it
'returns false when raw repo is blank'
do
branch
=
described_class
.
new
(
project
,
double
(
raw
.
merge
(
repo:
nil
)))
it
'returns false when raw sha is blank'
do
branch
=
described_class
.
new
(
project
,
double
(
raw
.
merge
(
sha:
nil
)))
expect
(
branch
.
valid?
).
to
eq
false
end
it
'returns false when raw ref is blank'
do
branch
=
described_class
.
new
(
project
,
double
(
raw
.
merge
(
ref:
nil
)))
expect
(
branch
.
valid?
).
to
eq
false
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