Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
佳 邓
Gitlab4j Api
Commits
b5392b8f
Unverified
Commit
b5392b8f
authored
May 17, 2020
by
Gerard Krupa
Committed by
GitHub
May 17, 2020
Browse files
Added commit_committer_check and reject_unsigned_commits to PushRules (#575)
parent
6c46720e
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/gitlab4j/api/ProjectApi.java
View file @
b5392b8f
...
@@ -2530,7 +2530,10 @@ public class ProjectApi extends AbstractApi implements Constants {
...
@@ -2530,7 +2530,10 @@ public class ProjectApi extends AbstractApi implements Constants {
.
withParam
(
"branch_name_regex"
,
pushRule
.
getBranchNameRegex
())
.
withParam
(
"branch_name_regex"
,
pushRule
.
getBranchNameRegex
())
.
withParam
(
"author_email_regex"
,
pushRule
.
getAuthorEmailRegex
())
.
withParam
(
"author_email_regex"
,
pushRule
.
getAuthorEmailRegex
())
.
withParam
(
"file_name_regex"
,
pushRule
.
getFileNameRegex
())
.
withParam
(
"file_name_regex"
,
pushRule
.
getFileNameRegex
())
.
withParam
(
"max_file_size"
,
pushRule
.
getMaxFileSize
());
.
withParam
(
"max_file_size"
,
pushRule
.
getMaxFileSize
())
.
withParam
(
"commit_committer_check"
,
pushRule
.
getCommitCommitterCheck
())
.
withParam
(
"reject_unsigned_commits"
,
pushRule
.
getRejectUnsignedCommits
());
Response
response
=
post
(
Response
.
Status
.
CREATED
,
formData
,
"projects"
,
getProjectIdOrPath
(
projectIdOrPath
),
"push_rule"
);
Response
response
=
post
(
Response
.
Status
.
CREATED
,
formData
,
"projects"
,
getProjectIdOrPath
(
projectIdOrPath
),
"push_rule"
);
return
(
response
.
readEntity
(
PushRules
.
class
));
return
(
response
.
readEntity
(
PushRules
.
class
));
...
@@ -2568,7 +2571,9 @@ public class ProjectApi extends AbstractApi implements Constants {
...
@@ -2568,7 +2571,9 @@ public class ProjectApi extends AbstractApi implements Constants {
.
withParam
(
"branch_name_regex"
,
pushRule
.
getBranchNameRegex
())
.
withParam
(
"branch_name_regex"
,
pushRule
.
getBranchNameRegex
())
.
withParam
(
"author_email_regex"
,
pushRule
.
getAuthorEmailRegex
())
.
withParam
(
"author_email_regex"
,
pushRule
.
getAuthorEmailRegex
())
.
withParam
(
"file_name_regex"
,
pushRule
.
getFileNameRegex
())
.
withParam
(
"file_name_regex"
,
pushRule
.
getFileNameRegex
())
.
withParam
(
"max_file_size"
,
pushRule
.
getMaxFileSize
());
.
withParam
(
"max_file_size"
,
pushRule
.
getMaxFileSize
())
.
withParam
(
"commit_committer_check"
,
pushRule
.
getCommitCommitterCheck
())
.
withParam
(
"reject_unsigned_commits"
,
pushRule
.
getRejectUnsignedCommits
());
final
Response
response
=
putWithFormData
(
Response
.
Status
.
OK
,
formData
,
"projects"
,
getProjectIdOrPath
(
projectIdOrPath
),
"push_rule"
);
final
Response
response
=
putWithFormData
(
Response
.
Status
.
OK
,
formData
,
"projects"
,
getProjectIdOrPath
(
projectIdOrPath
),
"push_rule"
);
return
(
response
.
readEntity
(
PushRules
.
class
));
return
(
response
.
readEntity
(
PushRules
.
class
));
...
...
src/main/java/org/gitlab4j/api/models/PushRules.java
View file @
b5392b8f
...
@@ -17,6 +17,8 @@ public class PushRules {
...
@@ -17,6 +17,8 @@ public class PushRules {
private
String
authorEmailRegex
;
private
String
authorEmailRegex
;
private
String
fileNameRegex
;
private
String
fileNameRegex
;
private
Integer
maxFileSize
;
private
Integer
maxFileSize
;
private
Boolean
commitCommitterCheck
;
private
Boolean
rejectUnsignedCommits
;
public
Integer
getId
()
{
public
Integer
getId
()
{
return
id
;
return
id
;
...
@@ -151,6 +153,32 @@ public class PushRules {
...
@@ -151,6 +153,32 @@ public class PushRules {
return
(
this
);
return
(
this
);
}
}
public
Boolean
getCommitCommitterCheck
()
{
return
commitCommitterCheck
;
}
public
void
setCommitCommitterCheck
(
Boolean
commitCommitterCheck
)
{
this
.
commitCommitterCheck
=
commitCommitterCheck
;
}
public
PushRules
withCommitCommitterCheck
(
Boolean
commitCommitterCheck
)
{
this
.
commitCommitterCheck
=
commitCommitterCheck
;
return
(
this
);
}
public
Boolean
getRejectUnsignedCommits
()
{
return
rejectUnsignedCommits
;
}
public
void
setRejectUnsignedCommits
(
Boolean
rejectUnsignedCommits
)
{
this
.
rejectUnsignedCommits
=
rejectUnsignedCommits
;
}
public
PushRules
withRejectUnsignedCommits
(
Boolean
rejectUnsignedCommits
)
{
this
.
rejectUnsignedCommits
=
rejectUnsignedCommits
;
return
(
this
);
}
@Override
@Override
public
String
toString
()
{
public
String
toString
()
{
return
(
JacksonJson
.
toJsonString
(
this
));
return
(
JacksonJson
.
toJsonString
(
this
));
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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