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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
c3be1517
Commit
c3be1517
authored
Nov 03, 2014
by
Ciro Santilli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Factor '0' * 40 blank ref constants
parent
1b140380
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
12 additions
and
7 deletions
+12
-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
lib/gitlab/git.rb
lib/gitlab/git.rb
+5
-0
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 @
c3be1517
...
@@ -160,19 +160,19 @@ class GitPushService
...
@@ -160,19 +160,19 @@ class GitPushService
ref_parts
=
ref
.
split
(
'/'
)
ref_parts
=
ref
.
split
(
'/'
)
# Return if this is not a push to a branch (e.g. new commits)
# 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
end
def
push_to_new_branch?
(
ref
,
oldrev
)
def
push_to_new_branch?
(
ref
,
oldrev
)
ref_parts
=
ref
.
split
(
'/'
)
ref_parts
=
ref
.
split
(
'/'
)
ref_parts
[
1
]
=~
/heads/
&&
oldrev
==
"0000000000000000000000000000000000000000"
ref_parts
[
1
]
=~
/heads/
&&
oldrev
==
Gitlab
::
Git
::
BLANK_SHA
end
end
def
push_remove_branch?
(
ref
,
newrev
)
def
push_remove_branch?
(
ref
,
newrev
)
ref_parts
=
ref
.
split
(
'/'
)
ref_parts
=
ref
.
split
(
'/'
)
ref_parts
[
1
]
=~
/heads/
&&
newrev
==
"0000000000000000000000000000000000000000"
ref_parts
[
1
]
=~
/heads/
&&
newrev
==
Gitlab
::
Git
::
BLANK_SHA
end
end
def
push_to_branch?
(
ref
)
def
push_to_branch?
(
ref
)
...
...
features/steps/dashboard/event_filters.rb
View file @
c3be1517
...
@@ -29,7 +29,7 @@ class Spinach::Features::EventFilters < Spinach::FeatureSteps
...
@@ -29,7 +29,7 @@ class Spinach::Features::EventFilters < Spinach::FeatureSteps
step
'this project has push event'
do
step
'this project has push event'
do
data
=
{
data
=
{
before:
"0000000000000000000000000000000000000000"
,
before:
Gitlab
::
Git
::
BLANK_SHA
,
after:
"0220c11b9a3e6c69dc8fd35321254ca9a7b98f7e"
,
after:
"0220c11b9a3e6c69dc8fd35321254ca9a7b98f7e"
,
ref:
"refs/heads/new_design"
,
ref:
"refs/heads/new_design"
,
user_id:
@user
.
id
,
user_id:
@user
.
id
,
...
...
features/steps/shared/project.rb
View file @
c3be1517
...
@@ -32,7 +32,7 @@ module SharedProject
...
@@ -32,7 +32,7 @@ module SharedProject
@project
=
Project
.
find_by
(
name:
"Shop"
)
@project
=
Project
.
find_by
(
name:
"Shop"
)
data
=
{
data
=
{
before:
"0000000000000000000000000000000000000000"
,
before:
Gitlab
::
Git
::
BLANK_SHA
,
after:
"6d394385cf567f80a8fd85055db1ab4c5295806f"
,
after:
"6d394385cf567f80a8fd85055db1ab4c5295806f"
,
ref:
"refs/heads/fix"
,
ref:
"refs/heads/fix"
,
user_id:
@user
.
id
,
user_id:
@user
.
id
,
...
...
lib/gitlab/git.rb
0 → 100644
View file @
c3be1517
module
Gitlab
module
Git
BLANK_SHA
=
'0'
*
40
end
end
spec/models/event_spec.rb
View file @
c3be1517
...
@@ -36,7 +36,7 @@ describe Event do
...
@@ -36,7 +36,7 @@ describe Event do
@user
=
project
.
owner
@user
=
project
.
owner
data
=
{
data
=
{
before:
"0000000000000000000000000000000000000000"
,
before:
Gitlab
::
Git
::
BLANK_SHA
,
after:
"0220c11b9a3e6c69dc8fd35321254ca9a7b98f7e"
,
after:
"0220c11b9a3e6c69dc8fd35321254ca9a7b98f7e"
,
ref:
"refs/heads/master"
,
ref:
"refs/heads/master"
,
user_id:
@user
.
id
,
user_id:
@user
.
id
,
...
...
spec/services/git_push_service_spec.rb
View file @
c3be1517
...
@@ -8,7 +8,7 @@ describe GitPushService do
...
@@ -8,7 +8,7 @@ describe GitPushService do
let
(
:service
)
{
GitPushService
.
new
}
let
(
:service
)
{
GitPushService
.
new
}
before
do
before
do
@blankrev
=
'0000000000000000000000000000000000000000'
@blankrev
=
Gitlab
::
Git
::
BLANK_SHA
@oldrev
=
sample_commit
.
parent_id
@oldrev
=
sample_commit
.
parent_id
@newrev
=
sample_commit
.
id
@newrev
=
sample_commit
.
id
@ref
=
'refs/heads/master'
@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