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
9d93a61a
Commit
9d93a61a
authored
Jul 12, 2018
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix find_branch call sites
parent
40ed88b7
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
21 deletions
+3
-21
app/models/repository.rb
app/models/repository.rb
+2
-2
lib/gitlab/git/repository.rb
lib/gitlab/git/repository.rb
+1
-1
spec/models/repository_spec.rb
spec/models/repository_spec.rb
+0
-18
No files found.
app/models/repository.rb
View file @
9d93a61a
...
@@ -174,8 +174,8 @@ class Repository
...
@@ -174,8 +174,8 @@ class Repository
CommitCollection
.
new
(
project
,
commits
,
ref
)
CommitCollection
.
new
(
project
,
commits
,
ref
)
end
end
def
find_branch
(
name
,
fresh_repo:
true
)
def
find_branch
(
name
)
raw_repository
.
find_branch
(
name
,
fresh_repo
)
raw_repository
.
find_branch
(
name
)
end
end
def
find_tag
(
name
)
def
find_tag
(
name
)
...
...
lib/gitlab/git/repository.rb
View file @
9d93a61a
...
@@ -1114,7 +1114,7 @@ module Gitlab
...
@@ -1114,7 +1114,7 @@ module Gitlab
end
end
def
can_be_merged?
(
source_sha
,
target_branch
)
def
can_be_merged?
(
source_sha
,
target_branch
)
if
target_sha
=
find_branch
(
target_branch
,
true
)
&
.
target
if
target_sha
=
find_branch
(
target_branch
)
&
.
target
!
gitaly_conflicts_client
(
source_sha
,
target_sha
).
conflicts?
!
gitaly_conflicts_client
(
source_sha
,
target_sha
).
conflicts?
else
else
false
false
...
...
spec/models/repository_spec.rb
View file @
9d93a61a
...
@@ -1022,24 +1022,6 @@ describe Repository do
...
@@ -1022,24 +1022,6 @@ describe Repository do
end
end
end
end
describe
'#find_branch'
do
context
'fresh_repo is true'
do
it
'delegates the call to raw_repository'
do
expect
(
repository
.
raw_repository
).
to
receive
(
:find_branch
).
with
(
'master'
,
true
)
repository
.
find_branch
(
'master'
,
fresh_repo:
true
)
end
end
context
'fresh_repo is false'
do
it
'delegates the call to raw_repository'
do
expect
(
repository
.
raw_repository
).
to
receive
(
:find_branch
).
with
(
'master'
,
false
)
repository
.
find_branch
(
'master'
,
fresh_repo:
false
)
end
end
end
describe
'#update_branch_with_hooks'
do
describe
'#update_branch_with_hooks'
do
let
(
:old_rev
)
{
'0b4bc9a49b562e85de7cc9e834518ea6828729b9'
}
# git rev-parse feature
let
(
:old_rev
)
{
'0b4bc9a49b562e85de7cc9e834518ea6828729b9'
}
# git rev-parse feature
let
(
:new_rev
)
{
'a74ae73c1ccde9b974a70e82b901588071dc142a'
}
# commit whose parent is old_rev
let
(
:new_rev
)
{
'a74ae73c1ccde9b974a70e82b901588071dc142a'
}
# commit whose parent is old_rev
...
...
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