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
b0b234f7
Commit
b0b234f7
authored
Nov 05, 2014
by
Valeriy Sizov
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #8234 from cirosantilli/factor-0000
Factor '0' * 40 blank ref constants [failure unrelated]
parents
70122e46
c3be1517
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
7 deletions
+7
-7
app/services/git_push_service.rb
app/services/git_push_service.rb
+3
-3
features/steps/dashboard/event_filters.rb
features/steps/dashboard/event_filters.rb
+1
-1
features/steps/shared/project.rb
features/steps/shared/project.rb
+1
-1
spec/models/event_spec.rb
spec/models/event_spec.rb
+1
-1
spec/services/git_push_service_spec.rb
spec/services/git_push_service_spec.rb
+1
-1
No files found.
app/services/git_push_service.rb
View file @
b0b234f7
...
...
@@ -160,19 +160,19 @@ class GitPushService
ref_parts
=
ref
.
split
(
'/'
)
# Return if this is not a push to a branch (e.g. new commits)
ref_parts
[
1
]
=~
/heads/
&&
oldrev
!=
"0000000000000000000000000000000000000000"
ref_parts
[
1
]
=~
/heads/
&&
oldrev
!=
Gitlab
::
Git
::
BLANK_SHA
end
def
push_to_new_branch?
(
ref
,
oldrev
)
ref_parts
=
ref
.
split
(
'/'
)
ref_parts
[
1
]
=~
/heads/
&&
oldrev
==
"0000000000000000000000000000000000000000"
ref_parts
[
1
]
=~
/heads/
&&
oldrev
==
Gitlab
::
Git
::
BLANK_SHA
end
def
push_remove_branch?
(
ref
,
newrev
)
ref_parts
=
ref
.
split
(
'/'
)
ref_parts
[
1
]
=~
/heads/
&&
newrev
==
"0000000000000000000000000000000000000000"
ref_parts
[
1
]
=~
/heads/
&&
newrev
==
Gitlab
::
Git
::
BLANK_SHA
end
def
push_to_branch?
(
ref
)
...
...
features/steps/dashboard/event_filters.rb
View file @
b0b234f7
...
...
@@ -29,7 +29,7 @@ class Spinach::Features::EventFilters < Spinach::FeatureSteps
step
'this project has push event'
do
data
=
{
before:
"0000000000000000000000000000000000000000"
,
before:
Gitlab
::
Git
::
BLANK_SHA
,
after:
"0220c11b9a3e6c69dc8fd35321254ca9a7b98f7e"
,
ref:
"refs/heads/new_design"
,
user_id:
@user
.
id
,
...
...
features/steps/shared/project.rb
View file @
b0b234f7
...
...
@@ -32,7 +32,7 @@ module SharedProject
@project
=
Project
.
find_by
(
name:
"Shop"
)
data
=
{
before:
"0000000000000000000000000000000000000000"
,
before:
Gitlab
::
Git
::
BLANK_SHA
,
after:
"6d394385cf567f80a8fd85055db1ab4c5295806f"
,
ref:
"refs/heads/fix"
,
user_id:
@user
.
id
,
...
...
spec/models/event_spec.rb
View file @
b0b234f7
...
...
@@ -36,7 +36,7 @@ describe Event do
@user
=
project
.
owner
data
=
{
before:
"0000000000000000000000000000000000000000"
,
before:
Gitlab
::
Git
::
BLANK_SHA
,
after:
"0220c11b9a3e6c69dc8fd35321254ca9a7b98f7e"
,
ref:
"refs/heads/master"
,
user_id:
@user
.
id
,
...
...
spec/services/git_push_service_spec.rb
View file @
b0b234f7
...
...
@@ -8,7 +8,7 @@ describe GitPushService do
let
(
:service
)
{
GitPushService
.
new
}
before
do
@blankrev
=
'0000000000000000000000000000000000000000'
@blankrev
=
Gitlab
::
Git
::
BLANK_SHA
@oldrev
=
sample_commit
.
parent_id
@newrev
=
sample_commit
.
id
@ref
=
'refs/heads/master'
...
...
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