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
934f1e90
Commit
934f1e90
authored
Apr 04, 2016
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Error 500 after renaming a project path
Closes #14885
parent
353365c7
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
1 deletion
+27
-1
CHANGELOG
CHANGELOG
+2
-1
app/controllers/projects_controller.rb
app/controllers/projects_controller.rb
+3
-0
spec/controllers/projects_controller_spec.rb
spec/controllers/projects_controller_spec.rb
+22
-0
No files found.
CHANGELOG
View file @
934f1e90
...
@@ -3,11 +3,12 @@ Please view this file on the master branch, on stable branches it's out of date.
...
@@ -3,11 +3,12 @@ Please view this file on the master branch, on stable branches it's out of date.
v 8.7.0 (unreleased)
v 8.7.0 (unreleased)
- All images in discussions and wikis now link to their source files !3464 (Connor Shea).
- All images in discussions and wikis now link to their source files !3464 (Connor Shea).
- Improved Markdown rendering performance !3389 (Yorick Peterse)
- Improved Markdown rendering performance !3389 (Yorick Peterse)
- Don't attempt to look up an avatar in repo if repo directory does not exist (Stan
h
u)
- Don't attempt to look up an avatar in repo if repo directory does not exist (Stan
H
u)
- Preserve time notes/comments have been updated at when moving issue
- Preserve time notes/comments have been updated at when moving issue
- Make HTTP(s) label consistent on clone bar (Stan Hu)
- Make HTTP(s) label consistent on clone bar (Stan Hu)
- Expose label description in API (Mariusz Jachimowicz)
- Expose label description in API (Mariusz Jachimowicz)
- Allow back dating on issues when created through the API
- Allow back dating on issues when created through the API
- Fix Error 500 after renaming a project path (Stan Hu)
- Fix avatar stretching by providing a cropping feature
- Fix avatar stretching by providing a cropping feature
- Add endpoints to archive or unarchive a project !3372
- Add endpoints to archive or unarchive a project !3372
- Add links to CI setup documentation from project settings and builds pages
- Add links to CI setup documentation from project settings and builds pages
...
...
app/controllers/projects_controller.rb
View file @
934f1e90
...
@@ -40,6 +40,9 @@ class ProjectsController < Projects::ApplicationController
...
@@ -40,6 +40,9 @@ class ProjectsController < Projects::ApplicationController
def
update
def
update
status
=
::
Projects
::
UpdateService
.
new
(
@project
,
current_user
,
project_params
).
execute
status
=
::
Projects
::
UpdateService
.
new
(
@project
,
current_user
,
project_params
).
execute
# Refresh the repo in case anything changed
@repository
=
project
.
repository
respond_to
do
|
format
|
respond_to
do
|
format
|
if
status
if
status
flash
[
:notice
]
=
"Project '
#{
@project
.
name
}
' was successfully updated."
flash
[
:notice
]
=
"Project '
#{
@project
.
name
}
' was successfully updated."
...
...
spec/controllers/projects_controller_spec.rb
View file @
934f1e90
...
@@ -83,6 +83,28 @@ describe ProjectsController do
...
@@ -83,6 +83,28 @@ describe ProjectsController do
end
end
end
end
describe
"#update"
do
render_views
let
(
:admin
)
{
create
(
:admin
)
}
it
"sets the repository to the right path after a rename"
do
new_path
=
'renamed_path'
project_params
=
{
path:
new_path
}
controller
.
instance_variable_set
(
:@project
,
project
)
sign_in
(
admin
)
put
:update
,
namespace_id:
project
.
namespace
.
to_param
,
id:
project
.
id
,
project:
project_params
expect
(
project
.
repository
.
path
).
to
include
(
new_path
)
expect
(
assigns
(
:repository
).
path
).
to
eq
(
project
.
repository
.
path
)
expect
(
response
.
status
).
to
eq
(
200
)
end
end
describe
"#destroy"
do
describe
"#destroy"
do
let
(
:admin
)
{
create
(
:admin
)
}
let
(
:admin
)
{
create
(
:admin
)
}
...
...
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