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
3161d5d2
Commit
3161d5d2
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
2298c003
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 @
3161d5d2
...
@@ -274,7 +274,7 @@ GEM
...
@@ -274,7 +274,7 @@ GEM
diff-lcs (~> 1.1)
diff-lcs (~> 1.1)
mime-types (>= 1.16, < 3)
mime-types (>= 1.16, < 3)
posix-spawn (~> 0.3)
posix-spawn (~> 0.3)
gitlab_git (10.
2.3
)
gitlab_git (10.
3.0
)
activesupport (~> 4.0)
activesupport (~> 4.0)
charlock_holmes (~> 0.7.3)
charlock_holmes (~> 0.7.3)
github-linguist (~> 4.7.0)
github-linguist (~> 4.7.0)
...
...
app/controllers/concerns/creates_commit.rb
View file @
3161d5d2
...
@@ -8,7 +8,6 @@ module CreatesCommit
...
@@ -8,7 +8,6 @@ module CreatesCommit
source_project:
@project
,
source_project:
@project
,
source_branch:
@ref
,
source_branch:
@ref
,
target_branch:
@target_branch
,
target_branch:
@target_branch
,
file_path:
@file_path
,
previous_path:
@previous_path
previous_path:
@previous_path
)
)
...
...
app/controllers/projects/blob_controller.rb
View file @
3161d5d2
...
@@ -39,16 +39,17 @@ class Projects::BlobController < Projects::ApplicationController
...
@@ -39,16 +39,17 @@ class Projects::BlobController < Projects::ApplicationController
def
update
def
update
unless
params
[
:file_name
].
empty?
unless
params
[
:file_name
].
empty?
@previous_path
=
@file_path
@previous_path
=
@path
@file_path
=
params
[
:file_name
]
@path
=
params
[
:file_name
]
@commit_params
[
:file_path
]
=
@path
end
end
after_edit_path
=
after_edit_path
=
if
from_merge_request
&&
@target_branch
==
@ref
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
)
+
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
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
end
create_commit
(
Files
::
UpdateService
,
success_path:
after_edit_path
,
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