From: James Moger Date: Fri, 21 Feb 2014 14:49:44 +0000 (-0500) Subject: Select default/configured gc period in create/edit repository page X-Git-Tag: v1.4.0~111^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Ftickets%2F09%2F9%2F2;p=gitblit.git Select default/configured gc period in create/edit repository page --- diff --git a/releases.moxie b/releases.moxie index a5339778..4fa313a7 100644 --- a/releases.moxie +++ b/releases.moxie @@ -21,6 +21,7 @@ r20: { - Fixed NPE when attempting to add a permission without a registrant (issue-344) - Invalidate all cached repository data on "clear cache" (issue-346) - Fix chart failures when an apostrophe is in a user display name (issue-350, pr-128) + - Fix exception in create repository when not selecting a garbage collection period (issue-366) - Stop setting admin permission based on undocumented Redmine REST API behavior (issue-368) - Fix support url decoding with non-ascii characters (pr-136) - Fix potential NPE on removing uncached repository from cache diff --git a/src/main/java/com/gitblit/wicket/pages/EditRepositoryPage.java b/src/main/java/com/gitblit/wicket/pages/EditRepositoryPage.java index bb166101..c4f480bb 100644 --- a/src/main/java/com/gitblit/wicket/pages/EditRepositoryPage.java +++ b/src/main/java/com/gitblit/wicket/pages/EditRepositoryPage.java @@ -449,6 +449,10 @@ public class EditRepositoryPage extends RootSubPage { form.add(new DropDownChoice("HEAD", availableRefs).setEnabled(availableRefs.size() > 0)); boolean gcEnabled = app().settings().getBoolean(Keys.git.enableGarbageCollection, false); + int defaultGcPeriod = app().settings().getInteger(Keys.git.defaultGarbageCollectionPeriod, 7); + if (repositoryModel.gcPeriod == 0) { + repositoryModel.gcPeriod = defaultGcPeriod; + } List gcPeriods = Arrays.asList(1, 2, 3, 4, 5, 7, 10, 14 ); form.add(new DropDownChoice("gcPeriod", gcPeriods, new GCPeriodRenderer()).setEnabled(gcEnabled)); form.add(new TextField("gcThreshold").setEnabled(gcEnabled));