Skip to content

Commit 2c0a9bd

Browse files
committed
Merge pull request #33 from ghaabor/expose_reload_config_method
Public method for UI-less reload in e. g. Groovy scripts
2 parents 758e0ea + 7fff7eb commit 2c0a9bd

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/main/java/hudson/plugins/scm_sync_configuration/ScmSyncConfigurationPlugin.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,16 @@ public Iterable<File> apply(ScmSyncStrategy strategy) {
262262
}}));
263263
}
264264

265+
// public method for UI-less reload in e. g. Groovy scripts
266+
public void reloadAllFilesFromScm() throws ServletException, IOException {
267+
try {
268+
filesModifiedByLastReload = business.reloadAllFilesFromScm();
269+
}
270+
catch(ScmException e) {
271+
throw new ServletException("Unable to reload SCM " + scm.getTitle() + ":" + getScmUrl(), e);
272+
}
273+
}
274+
265275
public void doReloadAllFilesFromScm(StaplerRequest req, StaplerResponse res) throws ServletException, IOException {
266276
try {
267277
filesModifiedByLastReload = business.reloadAllFilesFromScm();

0 commit comments

Comments
 (0)