Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
78771389
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 搜索 >>
提交
78771389
编写于
4月 03, 2016
作者:
S
Stan Hu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix creation of merge requests for orphaned branches
Closes #14875
上级
fee7ad86
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
35 addition
and
2 deletion
+35
-2
CHANGELOG
CHANGELOG
+1
-0
app/views/projects/diffs/_image.html.haml
app/views/projects/diffs/_image.html.haml
+5
-2
spec/features/merge_requests/create_new_mr_spec.rb
spec/features/merge_requests/create_new_mr_spec.rb
+28
-0
spec/support/test_env.rb
spec/support/test_env.rb
+1
-0
未找到文件。
CHANGELOG
浏览文件 @
78771389
...
...
@@ -15,6 +15,7 @@ v 8.7.0 (unreleased)
- Implement 'Groups View' as an option for dashboard preferences !3379 (Elias W.)
- Implement 'TODOs View' as an option for dashboard preferences !3379 (Elias W.)
- Gracefully handle notes on deleted commits in merge requests (Stan Hu)
- Fix creation of merge requests for orphaned branches (Stan Hu)
- Fall back to `In-Reply-To` and `References` headers when sub-addressing is not available (David Padilla)
- Remove "Congratulations!" tweet button on newly-created project. (Connor Shea)
...
...
app/views/projects/diffs/_image.html.haml
浏览文件 @
78771389
-
diff
=
diff_file
.
diff
-
file_raw_path
=
namespace_project_raw_path
(
@project
.
namespace
,
@project
,
tree_join
(
@commit
.
id
,
diff
.
new_path
))
-
old_commit_id
=
diff_refs
.
first
.
id
-
old_file_raw_path
=
namespace_project_raw_path
(
@project
.
namespace
,
@project
,
tree_join
(
old_commit_id
,
diff
.
old_path
))
// diff_refs will be nil for orphaned commits (e.g. first commit in repo)
-
if
diff_refs
-
old_commit_id
=
diff_refs
.
first
.
id
-
old_file_raw_path
=
namespace_project_raw_path
(
@project
.
namespace
,
@project
,
tree_join
(
old_commit_id
,
diff
.
old_path
))
-
if
diff
.
renamed_file
||
diff
.
new_file
||
diff
.
deleted_file
.image
%span
.wrap
...
...
spec/features/merge_requests/create_new_mr_spec.rb
0 → 100644
浏览文件 @
78771389
require
'spec_helper'
feature
'Create New Merge Request'
,
feature:
true
,
js:
false
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
,
:public
)
}
before
do
project
.
team
<<
[
user
,
:master
]
login_as
user
visit
namespace_project_merge_requests_path
(
project
.
namespace
,
project
)
end
it
'generates a diff for an orphaned branch'
do
click_link
'New Merge Request'
select
"orphaned-branch"
,
from:
"merge_request_source_branch"
select
"master"
,
from:
"merge_request_target_branch"
click_button
"Compare branches"
expect
(
page
).
to
have_content
"README.md"
expect
(
page
).
to
have_content
"wm.png"
fill_in
"merge_request_title"
,
with:
"Orphaned MR test"
click_button
"Submit merge request"
expect
(
page
).
to
have_content
'git checkout -b orphaned-branch origin/orphaned-branch'
end
end
spec/support/test_env.rb
浏览文件 @
78771389
...
...
@@ -15,6 +15,7 @@ module TestEnv
'lfs'
=>
'be93687'
,
'master'
=>
'5937ac0'
,
"'test'"
=>
'e56497b'
,
'orphaned-branch'
=>
'45127a9'
,
}
# gitlab-test-fork is a fork of gitlab-fork, but we don't necessarily
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录