Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
4d6e377c
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 搜索 >>
提交
4d6e377c
编写于
2月 24, 2017
作者:
S
Sanster
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix new MR form erroneously selects tag as source when branch of same name exists #23237
上级
6eeba4b1
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
38 addition
and
5 deletion
+38
-5
app/controllers/projects/merge_requests_controller.rb
app/controllers/projects/merge_requests_controller.rb
+2
-2
changelogs/unreleased/fix-issue-23237.yml
changelogs/unreleased/fix-issue-23237.yml
+4
-0
spec/features/merge_requests/create_new_mr_spec.rb
spec/features/merge_requests/create_new_mr_spec.rb
+27
-0
spec/features/projects/compare_spec.rb
spec/features/projects/compare_spec.rb
+2
-1
spec/support/test_env.rb
spec/support/test_env.rb
+3
-2
未找到文件。
app/controllers/projects/merge_requests_controller.rb
100644 → 100755
浏览文件 @
4d6e377c
...
...
@@ -402,7 +402,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController
if
params
[
:ref
].
present?
@ref
=
params
[
:ref
]
@commit
=
@repository
.
commit
(
@ref
)
@commit
=
@repository
.
commit
(
"refs/heads/
#{
@ref
}
"
)
end
render
layout:
false
...
...
@@ -413,7 +413,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController
if
params
[
:ref
].
present?
@ref
=
params
[
:ref
]
@commit
=
@target_project
.
commit
(
@ref
)
@commit
=
@target_project
.
commit
(
"refs/heads/
#{
@ref
}
"
)
end
render
layout:
false
...
...
changelogs/unreleased/fix-issue-23237.yml
0 → 100644
浏览文件 @
4d6e377c
---
title
:
"
Fixes
an
issue
in
the
new
merge
request
form,
where
a
tag
would
be
selected
instead
of
a
branch
when
they
have
the
same
names"
merge_request
:
9535
author
:
Weiqing Chu
spec/features/merge_requests/create_new_mr_spec.rb
浏览文件 @
4d6e377c
...
...
@@ -12,6 +12,33 @@ feature 'Create New Merge Request', feature: true, js: true do
login_as
user
end
it
'selects the source branch sha when a tag with the same name exists'
do
visit
namespace_project_merge_requests_path
(
project
.
namespace
,
project
)
click_link
'New Merge Request'
expect
(
page
).
to
have_content
(
'Source branch'
)
expect
(
page
).
to
have_content
(
'Target branch'
)
first
(
'.js-source-branch'
).
click
first
(
'.dropdown-source-branch .dropdown-content a'
,
text:
'v1.1.0'
).
click
expect
(
page
).
to
have_content
"b83d6e3"
end
it
'selects the target branch sha when a tag with the same name exists'
do
visit
namespace_project_merge_requests_path
(
project
.
namespace
,
project
)
click_link
'New Merge Request'
expect
(
page
).
to
have_content
(
'Source branch'
)
expect
(
page
).
to
have_content
(
'Target branch'
)
first
(
'.js-target-branch'
).
click
first
(
'.dropdown-target-branch .dropdown-content a'
,
text:
'v1.1.0'
).
click
expect
(
page
).
to
have_content
"b83d6e3"
end
it
'generates a diff for an orphaned branch'
do
visit
namespace_project_merge_requests_path
(
project
.
namespace
,
project
)
...
...
spec/features/projects/compare_spec.rb
浏览文件 @
4d6e377c
...
...
@@ -53,6 +53,7 @@ describe "Compare", js: true do
dropdown
=
find
(
".js-compare-
#{
dropdown_type
}
-dropdown"
)
dropdown
.
find
(
".compare-dropdown-toggle"
).
click
dropdown
.
fill_in
(
"Filter by Git revision"
,
with:
selection
)
find_link
(
selection
,
visible:
true
).
click
wait_for_ajax
dropdown
.
find_all
(
"a[data-ref=
\"
#{
selection
}
\"
]"
,
visible:
true
).
last
.
click
end
end
spec/support/test_env.rb
浏览文件 @
4d6e377c
...
...
@@ -37,9 +37,10 @@ module TestEnv
'conflict-too-large'
=>
'39fa04f'
,
'deleted-image-test'
=>
'6c17798'
,
'wip'
=>
'b9238ee'
,
'csv'
=>
'3dd0896'
'csv'
=>
'3dd0896'
,
'v1.1.0'
=>
'b83d6e3'
}.
freeze
# gitlab-test-fork is a fork of gitlab-fork, but we don't necessarily
# need to keep all the branches in sync.
# We currently only need a subset of the branches
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录