BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
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
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
2 deletions
+8
-2
creates_commit.rb
app/controllers/concerns/creates_commit.rb
+2
-1
blob_controller.rb
app/controllers/projects/blob_controller.rb
+5
-1
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
...
@@ -7,7 +7,8 @@ module CreatesCommit
commit_params
=
@commit_params
.
merge
(
commit_params
=
@commit_params
.
merge
(
source_project:
@project
,
source_project:
@project
,
source_branch:
@ref
,
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
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
...
@@ -44,7 +44,11 @@ class Projects::BlobController < Projects::ApplicationController
"#file-path-
#{
hexdigest
(
@path
)
}
"
"#file-path-
#{
hexdigest
(
@path
)
}
"
else
else
# params[:file_name] stores the new name for the file
# 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
end
create_commit
(
Files
::
UpdateService
,
success_path:
after_edit_path
,
create_commit
(
Files
::
UpdateService
,
success_path:
after_edit_path
,
...
...
app/services/files/base_service.rb
View file @
298abfd3
...
@@ -15,6 +15,7 @@ module Files
...
@@ -15,6 +15,7 @@ module Files
params
[
:file_content
]
params
[
:file_content
]
end
end
# Validate parameters
validate
validate
# Create new branch if it different from source_branch
# 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