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
f4de7309
Commit
f4de7309
authored
Jan 17, 2018
by
Jacob Vosmaer (GitLab)
Committed by
Sean McGivern
Jan 17, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unused methods from Gitlab::Git
parent
e6ddb2ee
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
39 deletions
+0
-39
lib/gitlab/git/repository.rb
lib/gitlab/git/repository.rb
+0
-31
spec/lib/gitlab/git/repository_spec.rb
spec/lib/gitlab/git/repository_spec.rb
+0
-8
No files found.
lib/gitlab/git/repository.rb
View file @
f4de7309
...
...
@@ -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 @
f4de7309
...
...
@@ -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