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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
08b462b9
Commit
08b462b9
authored
Jul 14, 2017
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove deprecated #heads method
parent
000ec953
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
40 deletions
+2
-40
lib/gitlab/git/repository.rb
lib/gitlab/git/repository.rb
+0
-7
spec/lib/gitlab/git/repository_spec.rb
spec/lib/gitlab/git/repository_spec.rb
+2
-33
No files found.
lib/gitlab/git/repository.rb
View file @
08b462b9
...
@@ -196,13 +196,6 @@ module Gitlab
...
@@ -196,13 +196,6 @@ module Gitlab
branch_names
+
tag_names
branch_names
+
tag_names
end
end
# Deprecated. Will be removed in 5.2
def
heads
rugged
.
references
.
each
(
"refs/heads/*"
).
map
do
|
head
|
Gitlab
::
Git
::
Ref
.
new
(
self
,
head
.
name
,
head
.
target
)
end
.
sort_by
(
&
:name
)
end
def
has_commits?
def
has_commits?
!
empty?
!
empty?
end
end
...
...
spec/lib/gitlab/git/repository_spec.rb
View file @
08b462b9
...
@@ -234,33 +234,6 @@ describe Gitlab::Git::Repository, seed_helper: true do
...
@@ -234,33 +234,6 @@ describe Gitlab::Git::Repository, seed_helper: true do
it
{
expect
(
repository
.
bare?
).
to
be_truthy
}
it
{
expect
(
repository
.
bare?
).
to
be_truthy
}
end
end
describe
'#heads'
do
let
(
:heads
)
{
repository
.
heads
}
subject
{
heads
}
it
{
is_expected
.
to
be_kind_of
Array
}
describe
'#size'
do
subject
{
super
().
size
}
it
{
is_expected
.
to
eq
(
SeedRepo
::
Repo
::
BRANCHES
.
size
)
}
end
context
:head
do
subject
{
heads
.
first
}
describe
'#name'
do
subject
{
super
().
name
}
it
{
is_expected
.
to
eq
(
"feature"
)
}
end
context
:commit
do
subject
{
heads
.
first
.
dereferenced_target
.
sha
}
it
{
is_expected
.
to
eq
(
"0b4bc9a49b562e85de7cc9e834518ea6828729b9"
)
}
end
end
end
describe
'#ref_names'
do
describe
'#ref_names'
do
let
(
:ref_names
)
{
repository
.
ref_names
}
let
(
:ref_names
)
{
repository
.
ref_names
}
subject
{
ref_names
}
subject
{
ref_names
}
...
@@ -521,7 +494,7 @@ describe Gitlab::Git::Repository, seed_helper: true do
...
@@ -521,7 +494,7 @@ describe Gitlab::Git::Repository, seed_helper: true do
end
end
it
"should refresh the repo's #heads collection"
do
it
"should refresh the repo's #heads collection"
do
head_names
=
@normal_repo
.
head
s
.
map
{
|
h
|
h
.
name
}
head_names
=
@normal_repo
.
branche
s
.
map
{
|
h
|
h
.
name
}
expect
(
head_names
).
to
include
(
new_branch
)
expect
(
head_names
).
to
include
(
new_branch
)
end
end
...
@@ -542,7 +515,7 @@ describe Gitlab::Git::Repository, seed_helper: true do
...
@@ -542,7 +515,7 @@ describe Gitlab::Git::Repository, seed_helper: true do
eq
(
normal_repo
.
rugged
.
branches
[
"master"
].
target
.
oid
)
eq
(
normal_repo
.
rugged
.
branches
[
"master"
].
target
.
oid
)
)
)
head_names
=
normal_repo
.
head
s
.
map
{
|
h
|
h
.
name
}
head_names
=
normal_repo
.
branche
s
.
map
{
|
h
|
h
.
name
}
expect
(
head_names
).
not_to
include
(
new_branch
)
expect
(
head_names
).
not_to
include
(
new_branch
)
end
end
...
@@ -589,10 +562,6 @@ describe Gitlab::Git::Repository, seed_helper: true do
...
@@ -589,10 +562,6 @@ describe Gitlab::Git::Repository, seed_helper: true do
expect
(
@repo
.
rugged
.
branches
[
"feature"
]).
to
be_nil
expect
(
@repo
.
rugged
.
branches
[
"feature"
]).
to
be_nil
end
end
it
"should update the repo's #heads collection"
do
expect
(
@repo
.
heads
).
not_to
include
(
"feature"
)
end
after
(
:all
)
do
after
(
:all
)
do
FileUtils
.
rm_rf
(
TEST_MUTABLE_REPO_PATH
)
FileUtils
.
rm_rf
(
TEST_MUTABLE_REPO_PATH
)
ensure_seeds
ensure_seeds
...
...
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