Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
java-gitlab-api
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
沈俊林
java-gitlab-api
Commits
1c170218
Commit
1c170218
authored
Apr 03, 2016
by
Tim Olshansky
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #128 from sstafford/issue127
Adding a default branch argument to the updateProject method.
parents
7ad6dd87
ac1cd584
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
10 deletions
+25
-10
GitlabAPI.java
src/main/java/org/gitlab/api/GitlabAPI.java
+25
-10
No files found.
src/main/java/org/gitlab/api/GitlabAPI.java
View file @
1c170218
...
...
@@ -750,6 +750,7 @@ public class GitlabAPI {
* @param projectId The id of the project to update
* @param name The name of the project
* @param description A description for the project, null otherwise
* @param defaultBranch The branch displayed in the Gitlab UI when a user navigates to the project
* @param issuesEnabled Whether Issues should be enabled, otherwise null indicates to use GitLab default
* @param wallEnabled Whether The Wall should be enabled, otherwise null indicates to use GitLab default
* @param mergeRequestsEnabled Whether Merge Requests should be enabled, otherwise null indicates to use GitLab default
...
...
@@ -760,10 +761,24 @@ public class GitlabAPI {
* @return the Gitlab Project
* @throws IOException on gitlab api call error
*/
public
GitlabProject
updateProject
(
Integer
projectId
,
String
name
,
String
description
,
Boolean
issuesEnabled
,
Boolean
wallEnabled
,
Boolean
mergeRequestsEnabled
,
Boolean
wikiEnabled
,
Boolean
snippetsEnabled
,
Boolean
publik
,
Integer
visibilityLevel
)
throws
IOException
{
public
GitlabProject
updateProject
(
Integer
projectId
,
String
name
,
String
description
,
String
defaultBranch
,
Boolean
issuesEnabled
,
Boolean
wallEnabled
,
Boolean
mergeRequestsEnabled
,
Boolean
wikiEnabled
,
Boolean
snippetsEnabled
,
Boolean
publik
,
Integer
visibilityLevel
)
throws
IOException
{
Query
query
=
new
Query
()
.
appendIf
(
"name"
,
name
)
.
appendIf
(
"description"
,
description
)
.
appendIf
(
"default_branch"
,
defaultBranch
)
.
appendIf
(
"issues_enabled"
,
issuesEnabled
)
.
appendIf
(
"wall_enabled"
,
wallEnabled
)
.
appendIf
(
"merge_requests_enabled"
,
mergeRequestsEnabled
)
...
...
@@ -875,9 +890,9 @@ public class GitlabAPI {
return
dispatch
().
to
(
tailUrl
,
GitlabMergeRequest
.
class
);
}
/**
* Updates a Merge Request
*
...
...
@@ -1221,7 +1236,7 @@ public class GitlabAPI {
* <a href="http://doc.gitlab.com/ce/api/branches.html#create-repository-branch">
* Create Repository Branch Documentation
* </a>
*
*
* @param project The gitlab project
* @param branchName The name of the branch to create
* @param ref The branch name or commit SHA to create branch from
...
...
@@ -1852,7 +1867,7 @@ public class GitlabAPI {
*/
public
CommitComment
createCommitComment
(
Integer
projectId
,
String
sha
,
String
note
,
String
path
,
String
line
,
String
line_type
)
throws
IOException
{
Query
query
=
new
Query
()
.
append
(
"id"
,
projectId
.
toString
())
.
appendIf
(
"sha"
,
sha
)
...
...
@@ -1861,10 +1876,10 @@ public class GitlabAPI {
.
appendIf
(
"line"
,
line
)
.
appendIf
(
"line_type"
,
line_type
);
String
tailUrl
=
GitlabProject
.
URL
+
"/"
+
sanitizeProjectId
(
projectId
)
+
"/repository/commits/"
+
sha
+
CommitComment
.
URL
+
query
.
toString
();
return
dispatch
().
to
(
tailUrl
,
CommitComment
.
class
);
}
/**
* Get the comments of a commit
*
...
...
@@ -1875,9 +1890,9 @@ public class GitlabAPI {
* @see <a href="http://doc.gitlab.com/ce/api/commits.html#post-comment-to-commit">http://doc.gitlab.com/ce/api/commits.html#post-comment-to-commit</a>
*/
public
List
<
CommitComment
>
getCommitComments
(
Integer
projectId
,
String
sha
)
throws
IOException
{
String
tailUrl
=
GitlabProject
.
URL
+
"/"
+
sanitizeProjectId
(
projectId
)
+
"/repository/commits/"
+
sha
+
CommitComment
.
URL
;
return
Arrays
.
asList
(
retrieve
().
to
(
tailUrl
,
CommitComment
[].
class
));
}
...
...
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