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
893f3f28
Commit
893f3f28
authored
Jul 12, 2016
by
tiagonbotelho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactors update action to change commit_params with the correct path
parent
cf96c759
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
Gemfile.lock
Gemfile.lock
+1
-1
app/controllers/concerns/creates_commit.rb
app/controllers/concerns/creates_commit.rb
+0
-1
app/controllers/projects/blob_controller.rb
app/controllers/projects/blob_controller.rb
+5
-4
No files found.
Gemfile.lock
View file @
893f3f28
...
...
@@ -274,7 +274,7 @@ GEM
diff-lcs (~> 1.1)
mime-types (>= 1.16, < 3)
posix-spawn (~> 0.3)
gitlab_git (10.
2.3
)
gitlab_git (10.
3.0
)
activesupport (~> 4.0)
charlock_holmes (~> 0.7.3)
github-linguist (~> 4.7.0)
...
...
app/controllers/concerns/creates_commit.rb
View file @
893f3f28
...
...
@@ -8,7 +8,6 @@ module CreatesCommit
source_project:
@project
,
source_branch:
@ref
,
target_branch:
@target_branch
,
file_path:
@file_path
,
previous_path:
@previous_path
)
...
...
app/controllers/projects/blob_controller.rb
View file @
893f3f28
...
...
@@ -39,16 +39,17 @@ class Projects::BlobController < Projects::ApplicationController
def
update
unless
params
[
:file_name
].
empty?
@previous_path
=
@file_path
@file_path
=
params
[
:file_name
]
@previous_path
=
@path
@path
=
params
[
:file_name
]
@commit_params
[
:file_path
]
=
@path
end
after_edit_path
=
if
from_merge_request
&&
@target_branch
==
@ref
diffs_namespace_project_merge_request_path
(
from_merge_request
.
target_project
.
namespace
,
from_merge_request
.
target_project
,
from_merge_request
)
+
"#file-path-
#{
hexdigest
(
@
file_
path
)
}
"
"#file-path-
#{
hexdigest
(
@path
)
}
"
else
namespace_project_blob_path
(
@project
.
namespace
,
@project
,
File
.
join
(
@target_branch
,
@
file_
path
))
namespace_project_blob_path
(
@project
.
namespace
,
@project
,
File
.
join
(
@target_branch
,
@path
))
end
create_commit
(
Files
::
UpdateService
,
success_path:
after_edit_path
,
...
...
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