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
9b8f51c9
Commit
9b8f51c9
authored
Jan 17, 2018
by
Sean McGivern
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'remove-branch-names-contains' into 'master'
Remove unused methods from Gitlab::Git See merge request gitlab-org/gitlab-ce!16494
parents
e6ddb2ee
f4de7309
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
39 deletions
+0
-39
repository.rb
lib/gitlab/git/repository.rb
+0
-31
repository_spec.rb
spec/lib/gitlab/git/repository_spec.rb
+0
-8
No files found.
lib/gitlab/git/repository.rb
View file @
9b8f51c9
...
...
@@ -621,37 +621,6 @@ module Gitlab
end
end
# Returns branch names collection that contains the special commit(SHA1
# or name)
#
# Ex.
# repo.branch_names_contains('master')
#
def
branch_names_contains
(
commit
)
branches_contains
(
commit
).
map
{
|
c
|
c
.
name
}
end
# Returns branch collection that contains the special commit(SHA1 or name)
#
# Ex.
# repo.branch_names_contains('master')
#
def
branches_contains
(
commit
)
commit_obj
=
rugged
.
rev_parse
(
commit
)
parent
=
commit_obj
.
parents
.
first
unless
commit_obj
.
parents
.
empty?
walker
=
Rugged
::
Walker
.
new
(
rugged
)
rugged
.
branches
.
select
do
|
branch
|
walker
.
push
(
branch
.
target_id
)
walker
.
hide
(
parent
)
if
parent
result
=
walker
.
any?
{
|
c
|
c
.
oid
==
commit_obj
.
oid
}
walker
.
reset
result
end
end
# Get refs hash which key is SHA1
# and value is a Rugged::Reference
def
refs_hash
...
...
spec/lib/gitlab/git/repository_spec.rb
View file @
9b8f51c9
...
...
@@ -1104,14 +1104,6 @@ describe Gitlab::Git::Repository, seed_helper: true do
end
end
describe
"branch_names_contains"
do
subject
{
repository
.
branch_names_contains
(
SeedRepo
::
LastCommit
::
ID
)
}
it
{
is_expected
.
to
include
(
'master'
)
}
it
{
is_expected
.
not_to
include
(
'feature'
)
}
it
{
is_expected
.
not_to
include
(
'fix'
)
}
end
describe
'#autocrlf'
do
before
(
:all
)
do
@repo
=
Gitlab
::
Git
::
Repository
.
new
(
'default'
,
TEST_MUTABLE_REPO_PATH
,
''
)
...
...
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