Skip to content

Commit bae822a

Browse files
authored
Merge pull request #722 from gitlab4j/issue-626-add-missing-properties-to-branch-model
Fix #626 : Add missing properties to Branch model
2 parents b442f13 + 847ce9e commit bae822a

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

src/main/java/org/gitlab4j/api/models/Branch.java

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ public class Branch {
1111
private Boolean merged;
1212
private String name;
1313
private Boolean isProtected;
14+
private Boolean isDefault;
15+
private Boolean canPush;
16+
private String webUrl;
1417

1518
public Commit getCommit() {
1619
return commit;
@@ -60,6 +63,30 @@ public void setProtected(Boolean isProtected) {
6063
this.isProtected = isProtected;
6164
}
6265

66+
public Boolean getDefault() {
67+
return isDefault;
68+
}
69+
70+
public void setDefault(Boolean isDefault) {
71+
this.isDefault = isDefault;
72+
}
73+
74+
public Boolean getCanPush() {
75+
return canPush;
76+
}
77+
78+
public void setCanPush(Boolean canPush) {
79+
this.canPush = canPush;
80+
}
81+
82+
public String getWebUrl() {
83+
return webUrl;
84+
}
85+
86+
public void setWebUrl(String webUrl) {
87+
this.webUrl = webUrl;
88+
}
89+
6390
public static final boolean isValid(Branch branch) {
6491
return (branch != null && branch.getName() != null);
6592
}
@@ -80,11 +107,23 @@ public Branch withDevelopersCanPush(Boolean developersCanPush) {
80107
return this;
81108
}
82109

110+
/**
111+
* Set the merged attribute
112+
* @param merged
113+
* @deprecated Use {@link #withMerged(Boolean)} instead
114+
* @return Current branch instance
115+
*/
116+
@Deprecated
83117
public Branch withDerged(Boolean merged) {
84118
this.merged = merged;
85119
return this;
86120
}
87121

122+
public Branch withMerged(Boolean merged) {
123+
this.merged = merged;
124+
return this;
125+
}
126+
88127
public Branch withName(String name) {
89128
this.name = name;
90129
return this;

src/test/resources/org/gitlab4j/api/branch.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@
22
"name": "master",
33
"merged": false,
44
"protected": true,
5+
"default": true,
56
"developers_can_push": false,
67
"developers_can_merge": false,
8+
"can_push": true,
9+
"web_url": "http://gitlab.example.com/my-group/my-project/-/tree/master",
710
"commit": {
811
"author_email": "[email protected]",
912
"author_name": "John Smith",
@@ -12,6 +15,8 @@
1215
"committer_email": "[email protected]",
1316
"committer_name": "John Smith",
1417
"id": "7b5c3cc8be40ee161ae89a06bba6229da1032a0c",
18+
"short_id": "7b5c3cc",
19+
"title": "add projects API",
1520
"message": "add projects API",
1621
"parent_ids": [
1722
"4ad91d3c1144c406e50c7b33bae684bd6837faf8"

0 commit comments

Comments
 (0)