Skip to content

Commit 34e3889

Browse files
committed
1. add getter getHasBranchFilter() in GogsProjectProperty, used in config.jelly to set branch filter check status;
2. remove default value of branch filter
1 parent 4999ffe commit 34e3889

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/main/java/org/jenkinsci/plugins/gogs/GogsProjectProperty.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ public String getGogsBranchFilter() {
5858
return this.gogsBranchFilter;
5959
}
6060

61+
public boolean getHasBranchFilter() {
62+
return gogsBranchFilter != null && gogsBranchFilter.length() > 0;
63+
}
64+
6165
private static final Logger LOGGER = Logger.getLogger(GogsWebHook.class.getName());
6266

6367
@Extension

src/main/resources/org/jenkinsci/plugins/gogs/GogsProjectProperty/config.jelly

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
<f:password field="gogsSecret" />
77
</f:entry>
88
</f:optionalBlock>
9-
<f:optionalBlock title="Branch Filter" inline="true" checked="${instance.gogsBranchFilter != null}">
10-
<f:entry title="${%BranchFilter}" description="default: master">
11-
<f:textbox default="master" field="gogsBranchFilter" />
9+
<f:optionalBlock title="Branch Filter" inline="true" checked="${instance.hasBranchFilter}">
10+
<f:entry title="${%BranchFilter}">
11+
<f:textbox field="gogsBranchFilter" />
1212
</f:entry>
1313
</f:optionalBlock>
1414
</f:section>

0 commit comments

Comments
 (0)