Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
bc4fec1f
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
bc4fec1f
编写于
5月 15, 2017
作者:
D
Douwe Maan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove @commit in compare and MR controllers
上级
7c479d88
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
4 addition
and
11 deletion
+4
-11
app/controllers/projects/compare_controller.rb
app/controllers/projects/compare_controller.rb
+1
-4
app/controllers/projects/merge_requests_controller.rb
app/controllers/projects/merge_requests_controller.rb
+0
-7
app/models/merge_request_diff.rb
app/models/merge_request_diff.rb
+3
-0
未找到文件。
app/controllers/projects/compare_controller.rb
浏览文件 @
bc4fec1f
...
...
@@ -51,12 +51,9 @@ class Projects::CompareController < Projects::ApplicationController
if
@compare
@commits
=
@compare
.
commits
@start_commit
=
@compare
.
start_commit
@commit
=
@compare
.
commit
@diffs
=
@compare
.
diffs
(
diff_options
)
environment_params
=
@repository
.
branch_exists?
(
@head_ref
)
?
{
ref:
@head_ref
}
:
{
commit:
@commit
}
environment_params
=
@repository
.
branch_exists?
(
@head_ref
)
?
{
ref:
@head_ref
}
:
{
commit:
@com
pare
.
com
mit
}
@environment
=
EnvironmentsFinder
.
new
(
@project
,
current_user
,
environment_params
).
execute
.
last
@diff_notes_disabled
=
true
...
...
app/controllers/projects/merge_requests_controller.rb
浏览文件 @
bc4fec1f
...
...
@@ -14,7 +14,6 @@ class Projects::MergeRequestsController < Projects::ApplicationController
]
before_action
:validates_merge_request
,
only:
[
:show
,
:diffs
,
:commits
,
:pipelines
]
before_action
:define_show_vars
,
only:
[
:diffs
,
:commits
,
:conflicts
,
:conflict_for_path
,
:builds
,
:pipelines
]
before_action
:define_commit_vars
,
only:
[
:diffs
]
before_action
:ensure_ref_fetched
,
only:
[
:show
,
:diffs
,
:commits
,
:builds
,
:conflicts
,
:conflict_for_path
,
:pipelines
]
before_action
:close_merge_request_without_source_project
,
only:
[
:show
,
:diffs
,
:commits
,
:builds
,
:pipelines
]
before_action
:check_if_can_be_merged
,
only: :show
...
...
@@ -130,8 +129,6 @@ class Projects::MergeRequestsController < Projects::ApplicationController
@diff_notes_disabled
=
true
end
define_commit_vars
render_diff_for_path
(
@diffs
)
end
...
...
@@ -500,10 +497,6 @@ class Projects::MergeRequestsController < Projects::ApplicationController
@notes
=
prepare_notes_for_rendering
(
@discussions
.
flat_map
(
&
:notes
))
end
def
define_commit_vars
@commit
=
@merge_request
.
diff_head_commit
end
def
define_diff_vars
@merge_request_diff
=
if
params
[
:diff_id
]
...
...
app/models/merge_request_diff.rb
浏览文件 @
bc4fec1f
...
...
@@ -159,6 +159,9 @@ class MergeRequestDiff < ActiveRecord::Base
# It is not good enough for highlighting diffs, so we can't simply pass
# these as `diff_refs.`
def
fallback_diff_refs
real_refs
=
diff_refs
return
real_refs
if
real_refs
likely_base_commit_sha
=
(
first_commit
&
.
parent
||
first_commit
)
&
.
sha
Gitlab
::
Diff
::
DiffRefs
.
new
(
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录