Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
7163b5b0
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,发现更多精彩内容 >>
提交
7163b5b0
编写于
8月 29, 2019
作者:
N
Nick Thomas
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'handle-invalid-mirror-url' into 'master'
Handle invalid mirror url See merge request gitlab-org/gitlab-ce!32353
上级
e6869b8f
72390953
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
17 addition
and
1 deletion
+17
-1
app/models/remote_mirror.rb
app/models/remote_mirror.rb
+1
-0
app/views/projects/mirrors/_mirror_repos.html.haml
app/views/projects/mirrors/_mirror_repos.html.haml
+1
-1
changelogs/unreleased/handle-invalid-mirror-url.yml
changelogs/unreleased/handle-invalid-mirror-url.yml
+5
-0
locale/gitlab.pot
locale/gitlab.pot
+3
-0
spec/models/remote_mirror_spec.rb
spec/models/remote_mirror_spec.rb
+7
-0
未找到文件。
app/models/remote_mirror.rb
浏览文件 @
7163b5b0
...
...
@@ -200,6 +200,7 @@ class RemoteMirror < ApplicationRecord
result
.
password
=
'*****'
if
result
.
password
result
.
user
=
'*****'
if
result
.
user
&&
result
.
user
!=
'git'
# tokens or other data may be saved as user
result
.
to_s
rescue
URI
::
Error
end
def
ensure_remote!
...
...
app/views/projects/mirrors/_mirror_repos.html.haml
浏览文件 @
7163b5b0
...
...
@@ -50,7 +50,7 @@
-
@project
.
remote_mirrors
.
each_with_index
do
|
mirror
,
index
|
-
next
if
mirror
.
new_record?
%tr
.qa-mirrored-repository-row.rspec-mirrored-repository-row
{
class:
(
'bg-secondary'
if
mirror
.
disabled?
)
}
%td
.qa-mirror-repository-url
=
mirror
.
safe_url
%td
.qa-mirror-repository-url
=
mirror
.
safe_url
||
_
(
'Invalid URL'
)
%td
=
_
(
'Push'
)
%td
=
mirror
.
last_update_started_at
.
present?
?
time_ago_with_tooltip
(
mirror
.
last_update_started_at
)
:
_
(
'Never'
)
...
...
changelogs/unreleased/handle-invalid-mirror-url.yml
0 → 100644
浏览文件 @
7163b5b0
---
title
:
Handle invalid mirror url
merge_request
:
32353
author
:
Lee Tickett
type
:
fixed
locale/gitlab.pot
浏览文件 @
7163b5b0
...
...
@@ -6110,6 +6110,9 @@ msgstr ""
msgid "Invalid Login or password"
msgstr ""
msgid "Invalid URL"
msgstr ""
msgid "Invalid date"
msgstr ""
...
...
spec/models/remote_mirror_spec.rb
浏览文件 @
7163b5b0
...
...
@@ -40,6 +40,13 @@ describe RemoteMirror, :mailer do
expect
(
remote_mirror
).
to
be_invalid
expect
(
remote_mirror
.
errors
[
:url
].
first
).
to
include
(
'Requests to the local network are not allowed'
)
end
it
'returns a nil safe_url'
do
remote_mirror
=
build
(
:remote_mirror
,
url:
'http://[0:0:0:0:ffff:123.123.123.123]/foo.git'
)
expect
(
remote_mirror
.
url
).
to
eq
(
'http://[0:0:0:0:ffff:123.123.123.123]/foo.git'
)
expect
(
remote_mirror
.
safe_url
).
to
be_nil
end
end
end
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录