Skip to content
GitLab
菜单
为什么选择 GitLab
定价
联系销售
探索
为什么选择 GitLab
定价
联系销售
探索
登录
获取免费试用
主导航
搜索或转到…
项目
GitLab
管理
动态
成员
标记
计划
议题
议题看板
里程碑
迭代
需求
代码
合并请求
仓库
分支
提交
标签
仓库图
比较修订版本
代码片段
锁定的文件
构建
流水线
作业
流水线计划
测试用例
产物
部署
发布
Package registry
Container registry
模型注册表
运维
环境
Terraform 模块
监控
事件
服务台
分析
价值流分析
贡献者分析
CI/CD 分析
仓库分析
代码评审分析
议题分析
洞察
模型实验
效能分析
帮助
帮助
支持
GitLab 文档
比较 GitLab 各版本
社区论坛
为极狐GitLab 提交贡献
提交反馈
隐私声明
快捷键
?
新增功能
4
代码片段
群组
项目
显示更多面包屑
gitlab-cn
GitLab
提交
34cc7cd8
提交
34cc7cd8
编辑于
9 years ago
作者:
Stan Hu
提交者:
Robert Speicher
9 years ago
浏览文件
操作
下载
补丁
差异文件
Fix error with file size check with submodules
Closes #152
上级
07b8d25d
No related branches found
分支 包含提交
No related tags found
标签 包含提交
无相关合并请求
变更
3
隐藏空白变更内容
行内
左右并排
显示
3 个更改的文件
CHANGELOG
+1
-2
1 个添加, 2 个删除
CHANGELOG
lib/gitlab/git_access.rb
+1
-1
1 个添加, 1 个删除
lib/gitlab/git_access.rb
spec/lib/gitlab/git_access_spec.rb
+7
-0
7 个添加, 0 个删除
spec/lib/gitlab/git_access_spec.rb
有
9 个添加
和
3 个删除
CHANGELOG
+
1
−
2
浏览文件 @
34cc7cd8
Please view this file on the master branch, on stable branches it's out of date.
v 8.3.0 (unreleased)
- Merge when build succeeds (Zeger-Jan van de Weg)
v 8.4.0 (unreleased)
- Autocomplete data is now always loaded, instead of when focusing a comment text area (Yorick Peterse)
- Improved performance of finding issues for an entire group (Yorick Peterse)
...
...
@@ -15,6 +13,7 @@ v 8.4.0 (unreleased)
- Fix missing date of month in network graph when commits span a month (Stan Hu)
- Expire view caches when application settings change (e.g. Gravatar disabled) (Stan Hu)
- Don't notify users twice if they are both project watchers and subscribers (Stan Hu)
- Fix error with file size check with submodules (Stan Hu)
- Implement new UI for group page
- Implement search inside emoji picker
- Add API support for looking up a user by username (Stan Hu)
...
...
此差异已折叠。
点击以展开。
lib/gitlab/git_access.rb
+
1
−
1
浏览文件 @
34cc7cd8
...
...
@@ -257,7 +257,7 @@ def check_commit_diff(commit, git_hook)
next
if
diff
.
deleted_file
blob
=
project
.
repository
.
blob_at
(
commit
.
id
,
diff
.
new_path
)
if
blob
.
size
>
git_hook
.
max_file_size
.
megabytes
if
blob
&&
blob
.
size
&&
blob
.
size
>
git_hook
.
max_file_size
.
megabytes
return
build_status_object
(
false
,
"File
#{
diff
.
new_path
.
inspect
}
is larger than the allowed size of
#{
git_hook
.
max_file_size
}
MB"
)
end
end
...
...
此差异已折叠。
点击以展开。
spec/lib/gitlab/git_access_spec.rb
+
7
−
0
浏览文件 @
34cc7cd8
...
...
@@ -311,6 +311,13 @@ def self.updated_permissions_matrix
project
.
git_hook
.
update
(
max_file_size:
2
)
expect
(
access
.
git_hook_check
(
user
,
project
,
'refs/heads/master'
,
'cfe32cf61b73a0d5e9f13e774abde7ff789b1660'
,
'913c66a37b4a45b9769037c55c2d238bd0942d2e'
)).
to
be_allowed
end
it
"returns true when size is nil"
do
allow_any_instance_of
(
Gitlab
::
Git
::
Blob
).
to
receive
(
:size
).
and_return
(
nil
)
project
.
create_git_hook
project
.
git_hook
.
update
(
max_file_size:
2
)
expect
(
access
.
git_hook_check
(
user
,
project
,
'refs/heads/master'
,
'cfe32cf61b73a0d5e9f13e774abde7ff789b1660'
,
'913c66a37b4a45b9769037c55c2d238bd0942d2e'
)).
to
be_allowed
end
end
end
end
此差异已折叠。
点击以展开。
预览
0%
加载中
请重试
或
添加新附件
.
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
保存评论
取消
想要评论请
注册
或
登录