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
f4b38792
Commit
f4b38792
authored
8 years ago
by
tiagonbotelho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
successfully adds the new version with the updated name on the projects repo
parent
3bda9621
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
2 deletions
+9
-2
app/controllers/concerns/creates_commit.rb
app/controllers/concerns/creates_commit.rb
+2
-1
app/controllers/projects/blob_controller.rb
app/controllers/projects/blob_controller.rb
+5
-1
app/services/files/base_service.rb
app/services/files/base_service.rb
+2
-0
No files found.
app/controllers/concerns/creates_commit.rb
View file @
f4b38792
...
...
@@ -7,7 +7,8 @@ module CreatesCommit
commit_params
=
@commit_params
.
merge
(
source_project:
@project
,
source_branch:
@ref
,
target_branch:
@target_branch
target_branch:
@target_branch
,
file_path:
@path
)
result
=
service
.
new
(
@tree_edit_project
,
current_user
,
commit_params
).
execute
...
...
This diff is collapsed.
Click to expand it.
app/controllers/projects/blob_controller.rb
View file @
f4b38792
...
...
@@ -44,7 +44,11 @@ class Projects::BlobController < Projects::ApplicationController
"#file-path-
#{
hexdigest
(
@path
)
}
"
else
# params[:file_name] stores the new name for the file
namespace_project_blob_path
(
@project
.
namespace
,
@project
,
File
.
join
(
@target_branch
,
params
[
:file_name
]))
unless
params
[
:file_name
]
==
@path
@path
=
params
[
:file_name
]
end
namespace_project_blob_path
(
@project
.
namespace
,
@project
,
File
.
join
(
@target_branch
,
@path
))
end
create_commit
(
Files
::
UpdateService
,
success_path:
after_edit_path
,
...
...
This diff is collapsed.
Click to expand it.
app/services/files/base_service.rb
View file @
f4b38792
...
...
@@ -15,6 +15,8 @@ module Files
params
[
:file_content
]
end
puts
@file_path
# Validate parameters
validate
...
...
This diff is collapsed.
Click to expand it.
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