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
38348aa1
Commit
38348aa1
authored
Nov 16, 2018
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove Gitlab::Git::Ref#full_ref
parent
2b4883e0
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
7 additions
and
46 deletions
+7
-46
app/models/project.rb
app/models/project.rb
+5
-7
lib/gitlab/git.rb
lib/gitlab/git.rb
+2
-2
lib/gitlab/git/branch.rb
lib/gitlab/git/branch.rb
+0
-4
lib/gitlab/git/ref.rb
lib/gitlab/git/ref.rb
+0
-4
lib/gitlab/git/tag.rb
lib/gitlab/git/tag.rb
+0
-4
spec/lib/gitlab/git/branch_spec.rb
spec/lib/gitlab/git/branch_spec.rb
+0
-12
spec/lib/gitlab/git/tag_spec.rb
spec/lib/gitlab/git/tag_spec.rb
+0
-13
No files found.
app/models/project.rb
View file @
38348aa1
...
...
@@ -1755,13 +1755,11 @@ class Project < ActiveRecord::Base
resolved_ref
=
resolve_ref
(
ref
)
return
false
unless
resolved_ref
full_ref
=
resolved_ref
.
full_ref
ref_name
=
resolved_ref
.
name
if
Gitlab
::
Git
.
branch_ref?
(
full_ref
)
ProtectedBranch
.
protected?
(
self
,
ref_name
)
elsif
Gitlab
::
Git
.
tag_ref?
(
full_ref
)
ProtectedTag
.
protected?
(
self
,
ref_name
)
case
resolved_ref
when
Gitlab
::
Git
::
Branch
ProtectedBranch
.
protected?
(
self
,
resolved_ref
.
name
)
when
Gitlab
::
Git
::
Tag
ProtectedTag
.
protected?
(
self
,
resolved_ref
.
name
)
end
end
...
...
lib/gitlab/git.rb
View file @
38348aa1
...
...
@@ -54,11 +54,11 @@ module Gitlab
end
def
tag_ref?
(
ref
)
ref
=~
%r{
#{
TAG_REF_PREFIX
}
\w
+}
ref
=~
/
#{
TAG_REF_PREFIX
}
\w+/
end
def
branch_ref?
(
ref
)
ref
=~
%r{
#{
BRANCH_REF_PREFIX
}
\w
+}
ref
=~
/
#{
BRANCH_REF_PREFIX
}
\w+/
end
def
blank_ref?
(
ref
)
...
...
lib/gitlab/git/branch.rb
View file @
38348aa1
...
...
@@ -28,10 +28,6 @@ module Gitlab
def
state
active?
?
:active
:
:stale
end
def
full_ref
Gitlab
::
Git
::
BRANCH_REF_PREFIX
+
name
end
end
end
end
lib/gitlab/git/ref.rb
View file @
38348aa1
...
...
@@ -39,10 +39,6 @@ module Gitlab
nil
end
end
def
full_ref
raise
NotImplementedError
end
end
end
end
lib/gitlab/git/tag.rb
View file @
38348aa1
...
...
@@ -62,10 +62,6 @@ module Gitlab
encode!
@message
end
def
full_ref
Gitlab
::
Git
::
TAG_REF_PREFIX
+
name
end
private
def
message_from_gitaly_tag
...
...
spec/lib/gitlab/git/branch_spec.rb
View file @
38348aa1
...
...
@@ -124,18 +124,6 @@ describe Gitlab::Git::Branch, :seed_helper do
it
{
expect
(
repository
.
branches
.
size
).
to
eq
(
SeedRepo
::
Repo
::
BRANCHES
.
size
)
}
describe
'#full_ref'
do
subject
do
described_class
.
new
(
repository
,
'master'
,
repository
.
commit
.
sha
,
repository
.
commit
).
full_ref
end
it
'returns the full ref'
do
is_expected
.
to
eq
(
'refs/heads/master'
)
end
end
def
create_commit
params
[
:message
].
delete!
(
"
\r
"
)
Rugged
::
Commit
.
create
(
rugged
,
params
.
merge
(
committer:
committer
.
merge
(
time:
Time
.
now
)))
...
...
spec/lib/gitlab/git/tag_spec.rb
View file @
38348aa1
...
...
@@ -69,17 +69,4 @@ describe Gitlab::Git::Tag, :seed_helper do
end
end
end
describe
'#full_ref'
do
subject
do
described_class
.
new
(
repository
,
{
name:
'master'
,
target:
repository
.
commit
.
sha
,
target_commit:
repository
.
commit
})
.
full_ref
end
it
'returns the full ref'
do
is_expected
.
to
eq
(
'refs/tags/master'
)
end
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