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
2dac3843
Commit
2dac3843
authored
Aug 30, 2018
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'upstream/master' into ce-to-ee-2018-08-30
parents
7b68798b
b8856d66
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
65 additions
and
6 deletions
+65
-6
app/models/concerns/optionally_search.rb
app/models/concerns/optionally_search.rb
+1
-1
app/services/projects/transfer_service.rb
app/services/projects/transfer_service.rb
+3
-2
app/views/projects/merge_requests/_how_to_merge.html.haml
app/views/projects/merge_requests/_how_to_merge.html.haml
+4
-2
changelogs/unreleased/41292-users-stuck-on-a-redirect-loop-after-transferring-project.yml
...s-stuck-on-a-redirect-loop-after-transferring-project.yml
+5
-0
changelogs/unreleased/50414-rubocop-rule-to-enforce-class-methods-over-module.yml
...414-rubocop-rule-to-enforce-class-methods-over-module.yml
+5
-0
changelogs/unreleased/sh-fix-error-500-updating-wikis.yml
changelogs/unreleased/sh-fix-error-500-updating-wikis.yml
+5
-0
lib/gitlab/encoding_helper.rb
lib/gitlab/encoding_helper.rb
+1
-1
spec/lib/gitlab/encoding_helper_spec.rb
spec/lib/gitlab/encoding_helper_spec.rb
+12
-0
spec/services/projects/transfer_service_spec.rb
spec/services/projects/transfer_service_spec.rb
+29
-0
No files found.
app/models/concerns/optionally_search.rb
View file @
2dac3843
...
...
@@ -3,7 +3,7 @@
module
OptionallySearch
extend
ActiveSupport
::
Concern
module
ClassMethods
class_methods
do
def
search
(
*
)
raise
(
NotImplementedError
,
...
...
app/services/projects/transfer_service.rb
View file @
2dac3843
...
...
@@ -45,8 +45,8 @@ module Projects
@new_path
=
File
.
join
(
@new_namespace
.
try
(
:full_path
)
||
''
,
project
.
path
)
@old_namespace
=
project
.
namespace
if
Project
.
where
(
path:
project
.
path
,
namespace_id:
@new_namespace
.
try
(
:id
)
).
exists?
raise
TransferError
.
new
(
"Project with same path in target namespace already exists"
)
if
Project
.
where
(
namespace_id:
@new_namespace
.
try
(
:id
)).
where
(
'path = ? or name = ?'
,
project
.
path
,
project
.
name
).
exists?
raise
TransferError
.
new
(
"Project with same
name or
path in target namespace already exists"
)
end
if
project
.
has_container_registry_tags?
...
...
@@ -120,6 +120,7 @@ module Projects
def
rollback_side_effects
rollback_folder_move
project
.
reload
update_namespace_and_visibility
(
@old_namespace
)
write_repository_config
(
@old_path
)
end
...
...
app/views/projects/merge_requests/_how_to_merge.html.haml
View file @
2dac3843
...
...
@@ -30,11 +30,13 @@
%pre
.dark
#merge-info-3
-
if
@merge_request
.
for_fork?
:preserve
git checkout
#{
h
@merge_request
.
target_branch
}
git fetch origin
git checkout origin/
#{
h
@merge_request
.
target_branch
}
git merge --no-ff
#{
h
@merge_request
.
source_project_path
}
-
#{
h
@merge_request
.
source_branch
}
-
else
:preserve
git checkout
#{
h
@merge_request
.
target_branch
}
git fetch origin
git checkout origin/
#{
h
@merge_request
.
target_branch
}
git merge --no-ff
#{
h
@merge_request
.
source_branch
}
%p
%strong
Step 4.
...
...
changelogs/unreleased/41292-users-stuck-on-a-redirect-loop-after-transferring-project.yml
0 → 100644
View file @
2dac3843
---
title
:
Fix project transfer name validation issues causing a redirect loop
merge_request
:
21408
author
:
type
:
fixed
changelogs/unreleased/50414-rubocop-rule-to-enforce-class-methods-over-module.yml
0 → 100644
View file @
2dac3843
---
title
:
Adds Rubocop rule to enforce class_methods over module ClassMethods
merge_request
:
21379
author
:
Jacopo Beschi @jacopo-beschi
type
:
added
changelogs/unreleased/sh-fix-error-500-updating-wikis.yml
0 → 100644
View file @
2dac3843
---
title
:
Fix Error 500s due to encoding issues when Wiki hooks fire
merge_request
:
21414
author
:
type
:
fixed
lib/gitlab/encoding_helper.rb
View file @
2dac3843
...
...
@@ -75,7 +75,7 @@ module Gitlab
end
def
binary_stringio
(
str
)
StringIO
.
new
(
str
||
''
).
tap
{
|
io
|
io
.
set_encoding
(
Encoding
::
ASCII_8BIT
)
}
StringIO
.
new
(
str
.
freeze
||
''
).
tap
{
|
io
|
io
.
set_encoding
(
Encoding
::
ASCII_8BIT
)
}
end
private
...
...
spec/lib/gitlab/encoding_helper_spec.rb
View file @
2dac3843
# coding: utf-8
require
"spec_helper"
describe
Gitlab
::
EncodingHelper
do
...
...
@@ -187,4 +188,15 @@ describe Gitlab::EncodingHelper do
end
end
end
describe
'#binary_stringio'
do
it
'does not mutate the original string encoding'
do
test
=
'my-test'
io_stream
=
ext_class
.
binary_stringio
(
test
)
expect
(
io_stream
.
external_encoding
.
name
).
to
eq
(
'ASCII-8BIT'
)
expect
(
test
.
encoding
.
name
).
to
eq
(
'UTF-8'
)
end
end
end
spec/services/projects/transfer_service_spec.rb
View file @
2dac3843
...
...
@@ -169,6 +169,35 @@ describe Projects::TransferService do
it
{
expect
(
project
.
errors
[
:new_namespace
]).
to
include
(
'Cannot move project'
)
}
end
context
'target namespace containing the same project name'
do
before
do
group
.
add_owner
(
user
)
project
.
update
(
name:
'new_name'
)
create
(
:project
,
name:
'new_name'
,
group:
group
,
path:
'other'
)
@result
=
transfer_project
(
project
,
user
,
group
)
end
it
{
expect
(
@result
).
to
eq
false
}
it
{
expect
(
project
.
namespace
).
to
eq
(
user
.
namespace
)
}
it
{
expect
(
project
.
errors
[
:new_namespace
]).
to
include
(
'Project with same name or path in target namespace already exists'
)
}
end
context
'target namespace containing the same project path'
do
before
do
group
.
add_owner
(
user
)
create
(
:project
,
name:
'other-name'
,
path:
project
.
path
,
group:
group
)
@result
=
transfer_project
(
project
,
user
,
group
)
end
it
{
expect
(
@result
).
to
eq
false
}
it
{
expect
(
project
.
namespace
).
to
eq
(
user
.
namespace
)
}
it
{
expect
(
project
.
errors
[
:new_namespace
]).
to
include
(
'Project with same name or path in target namespace already exists'
)
}
end
def
transfer_project
(
project
,
user
,
new_namespace
)
service
=
Projects
::
TransferService
.
new
(
project
,
user
)
...
...
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