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
cceb2dd2
Commit
cceb2dd2
authored
May 07, 2015
by
Sytse Sijbrandij
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce
parents
deddad60
7a23be3a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
1 deletion
+19
-1
CHANGELOG
CHANGELOG
+1
-0
app/services/git_push_service.rb
app/services/git_push_service.rb
+4
-0
spec/services/git_push_service_spec.rb
spec/services/git_push_service_spec.rb
+14
-1
No files found.
CHANGELOG
View file @
cceb2dd2
Please view this file on the master branch, on stable branches it's out of date.
Please view this file on the master branch, on stable branches it's out of date.
v 7.11.0 (unreleased)
v 7.11.0 (unreleased)
- Make the first branch pushed to an empty repository the default HEAD (Stan Hu)
- Make Reply-To config apply to change e-mail confirmation and other Devise notifications (Stan Hu)
- Make Reply-To config apply to change e-mail confirmation and other Devise notifications (Stan Hu)
- Add application setting to restrict user signups to e-mail domains (Stan Hu)
- Add application setting to restrict user signups to e-mail domains (Stan Hu)
- Don't allow a merge request to be merged when its title starts with "WIP".
- Don't allow a merge request to be merged when its title starts with "WIP".
...
...
app/services/git_push_service.rb
View file @
cceb2dd2
...
@@ -31,6 +31,10 @@ class GitPushService
...
@@ -31,6 +31,10 @@ class GitPushService
# Initial push to the default branch. Take the full history of that branch as "newly pushed".
# Initial push to the default branch. Take the full history of that branch as "newly pushed".
@push_commits
=
project
.
repository
.
commits
(
newrev
)
@push_commits
=
project
.
repository
.
commits
(
newrev
)
# Ensure HEAD points to the default branch in case it is not master
branch_name
=
Gitlab
::
Git
.
ref_name
(
ref
)
project
.
change_head
(
branch_name
)
# Set protection on the default branch if configured
# Set protection on the default branch if configured
if
(
current_application_settings
.
default_branch_protection
!=
PROTECTION_NONE
)
if
(
current_application_settings
.
default_branch_protection
!=
PROTECTION_NONE
)
developers_can_push
=
current_application_settings
.
default_branch_protection
==
PROTECTION_DEV_CAN_PUSH
?
true
:
false
developers_can_push
=
current_application_settings
.
default_branch_protection
==
PROTECTION_DEV_CAN_PUSH
?
true
:
false
...
...
spec/services/git_push_service_spec.rb
View file @
cceb2dd2
...
@@ -234,5 +234,18 @@ describe GitPushService do
...
@@ -234,5 +234,18 @@ describe GitPushService do
expect
(
Issue
.
find
(
issue
.
id
)).
to
be_opened
expect
(
Issue
.
find
(
issue
.
id
)).
to
be_opened
end
end
end
end
end
describe
"empty project"
do
let
(
:project
)
{
create
(
:project_empty_repo
)
}
let
(
:new_ref
)
{
'refs/heads/feature'
}
before
do
allow
(
project
).
to
receive
(
:default_branch
).
and_return
(
'feature'
)
expect
(
project
).
to
receive
(
:change_head
)
{
'feature'
}
end
it
'push to first branch updates HEAD'
do
service
.
execute
(
project
,
user
,
@blankrev
,
@newrev
,
new_ref
)
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