Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
e9b45f58
Commit
e9b45f58
authored
Jan 05, 2016
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix error with file size check with submodules
Closes #152
parent
f8bfaa43
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
3 deletions
+9
-3
CHANGELOG
CHANGELOG
+1
-2
lib/gitlab/git_access.rb
lib/gitlab/git_access.rb
+1
-1
spec/lib/gitlab/git_access_spec.rb
spec/lib/gitlab/git_access_spec.rb
+7
-0
No files found.
CHANGELOG
View file @
e9b45f58
Please view this file on the master branch, on stable branches it's out of date.
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)
v 8.4.0 (unreleased)
- Fix error with file size check with submodules (Stan Hu)
- Implement new UI for group page
- Implement new UI for group page
- Implement search inside emoji picker
- Implement search inside emoji picker
- Add API support for looking up a user by username (Stan Hu)
- Add API support for looking up a user by username (Stan Hu)
...
...
lib/gitlab/git_access.rb
View file @
e9b45f58
...
@@ -257,7 +257,7 @@ module Gitlab
...
@@ -257,7 +257,7 @@ module Gitlab
next
if
diff
.
deleted_file
next
if
diff
.
deleted_file
blob
=
project
.
repository
.
blob_at
(
commit
.
id
,
diff
.
new_path
)
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"
)
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
end
end
...
...
spec/lib/gitlab/git_access_spec.rb
View file @
e9b45f58
...
@@ -311,6 +311,13 @@ describe Gitlab::GitAccess, lib: true do
...
@@ -311,6 +311,13 @@ describe Gitlab::GitAccess, lib: true do
project
.
git_hook
.
update
(
max_file_size:
2
)
project
.
git_hook
.
update
(
max_file_size:
2
)
expect
(
access
.
git_hook_check
(
user
,
project
,
'refs/heads/master'
,
'cfe32cf61b73a0d5e9f13e774abde7ff789b1660'
,
'913c66a37b4a45b9769037c55c2d238bd0942d2e'
)).
to
be_allowed
expect
(
access
.
git_hook_check
(
user
,
project
,
'refs/heads/master'
,
'cfe32cf61b73a0d5e9f13e774abde7ff789b1660'
,
'913c66a37b4a45b9769037c55c2d238bd0942d2e'
)).
to
be_allowed
end
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
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment