From b23b67c1cc0b2541580f23c9aec97c0b84a823f4 Mon Sep 17 00:00:00 2001 From: James Moger Date: Fri, 21 Feb 2014 09:49:44 -0500 Subject: [PATCH] Select default/configured gc period in create/edit repository page --- releases.moxie | 1 + .../java/com/gitblit/wicket/pages/EditRepositoryPage.java | 4 ++++ 2 files changed, 5 insertions(+) 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)); -- 2.39.5