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
de6b276e
Commit
de6b276e
authored
Dec 28, 2015
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Doesn't accept null value for max file size on Git hooks
parent
d315f7c9
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
2 deletions
+10
-2
CHANGELOG-EE
CHANGELOG-EE
+1
-0
app/models/git_hook.rb
app/models/git_hook.rb
+1
-0
db/migrate/20151228203337_change_max_file_size_to_not_null_on_git_hooks.rb
...28203337_change_max_file_size_to_not_null_on_git_hooks.rb
+5
-0
db/schema.rb
db/schema.rb
+2
-2
spec/models/git_hook_spec.rb
spec/models/git_hook_spec.rb
+1
-0
No files found.
CHANGELOG-EE
View file @
de6b276e
v 8.4.0 (unreleased)
- Add ability to create a note for user by admin
- Fix "Commit was rejected by git hook", when max_file_size was set null in project's Git hooks
v 8.3.0
- License information can now be retrieved via the API
...
...
app/models/git_hook.rb
View file @
de6b276e
...
...
@@ -2,6 +2,7 @@ class GitHook < ActiveRecord::Base
belongs_to
:project
validates
:project
,
presence:
true
,
unless:
"is_sample?"
validates
:max_file_size
,
numericality:
{
greater_than_or_equal_to:
0
,
only_integer:
true
}
def
commit_validation?
commit_message_regex
.
present?
||
...
...
db/migrate/20151228203337_change_max_file_size_to_not_null_on_git_hooks.rb
0 → 100644
View file @
de6b276e
class
ChangeMaxFileSizeToNotNullOnGitHooks
<
ActiveRecord
::
Migration
def
change
change_column_null
:git_hooks
,
:max_file_size
,
false
,
0
end
end
db/schema.rb
View file @
de6b276e
...
...
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
201512
15132013
)
do
ActiveRecord
::
Schema
.
define
(
version:
201512
28203337
)
do
# These are extensions that must be enabled in order to support this database
enable_extension
"plpgsql"
...
...
@@ -400,7 +400,7 @@ ActiveRecord::Schema.define(version: 20151215132013) do
t
.
boolean
"member_check"
,
default:
false
,
null:
false
t
.
string
"file_name_regex"
,
limit:
255
t
.
boolean
"is_sample"
,
default:
false
t
.
integer
"max_file_size"
,
default:
0
t
.
integer
"max_file_size"
,
default:
0
,
null:
false
end
create_table
"historical_data"
,
force: :cascade
do
|
t
|
...
...
spec/models/git_hook_spec.rb
View file @
de6b276e
...
...
@@ -7,5 +7,6 @@ describe GitHook do
describe
"Validation"
do
it
{
should
validate_presence_of
(
:project
)
}
it
{
should
validate_numericality_of
(
:max_file_size
).
is_greater_than_or_equal_to
(
0
).
only_integer
}
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