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
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
ab54a183
Commit
ab54a183
authored
Dec 01, 2016
by
Sean McGivern
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix/github-importer' into 'master'
Fix GitHub importer to import PR where source repo/fork was renamed/deleted Closes #24594 See merge request !7865
parents
9e8df307
20720d6a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
4 deletions
+14
-4
fix-github-branch-formatter.yml
changelogs/unreleased/fix-github-branch-formatter.yml
+4
-0
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.
changelogs/unreleased/fix-github-branch-formatter.yml
0 → 100644
View file @
ab54a183
---
title
:
Fix branch validation for GitHub PR where repo/fork was renamed/deleted
merge_request
:
author
:
lib/gitlab/github_import/branch_formatter.rb
View file @
ab54a183
...
@@ -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 @
ab54a183
...
@@ -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