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
298abfd3
Commit
298abfd3
authored
Jul 01, 2016
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
fe40a148
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
2 deletions
+8
-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
+1
-0
No files found.
app/controllers/concerns/creates_commit.rb
View file @
298abfd3
...
...
@@ -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
...
...
app/controllers/projects/blob_controller.rb
View file @
298abfd3
...
...
@@ -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
,
...
...
app/services/files/base_service.rb
View file @
298abfd3
...
...
@@ -15,6 +15,7 @@ module Files
params
[
:file_content
]
end
# Validate parameters
validate
# Create new branch if it different from source_branch
...
...
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