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
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
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
+10
-4
lib/gitlab/github_import/branch_formatter.rb
lib/gitlab/github_import/branch_formatter.rb
+1
-1
spec/lib/gitlab/github_import/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
...
@@ -8,7 +8,7 @@ module Gitlab
end
end
def
valid?
def
valid?
repo
.
present?
sha
.
present?
&&
ref
.
present?
end
end
private
private
...
...
spec/lib/gitlab/github_import/branch_formatter_spec.rb
View file @
8ca040d8
...
@@ -49,14 +49,20 @@ describe Gitlab::GithubImport::BranchFormatter, lib: true do
...
@@ -49,14 +49,20 @@ describe Gitlab::GithubImport::BranchFormatter, lib: true do
end
end
describe
'#valid?'
do
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
))
branch
=
described_class
.
new
(
project
,
double
(
raw
))
expect
(
branch
.
valid?
).
to
eq
true
expect
(
branch
.
valid?
).
to
eq
true
end
end
it
'returns false when raw repo is blank'
do
it
'returns false when raw sha is blank'
do
branch
=
described_class
.
new
(
project
,
double
(
raw
.
merge
(
repo:
nil
)))
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
expect
(
branch
.
valid?
).
to
eq
false
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