From ddbf6701b4df04d2c7a84080dfb4d64ef9d3f7a0 Mon Sep 17 00:00:00 2001 From: James Moger Date: Thu, 2 Feb 2012 19:10:21 -0500 Subject: [PATCH] Fixed bug in repository creation related to relinking head feature --- src/com/gitblit/wicket/pages/EditRepositoryPage.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/com/gitblit/wicket/pages/EditRepositoryPage.java b/src/com/gitblit/wicket/pages/EditRepositoryPage.java index a16d7e40..ec52aaf8 100644 --- a/src/com/gitblit/wicket/pages/EditRepositoryPage.java +++ b/src/com/gitblit/wicket/pages/EditRepositoryPage.java @@ -271,8 +271,13 @@ public class EditRepositoryPage extends RootSubPage { form.add(new CheckBox("isFrozen")); // TODO enable origin definition form.add(new TextField("origin").setEnabled(false/* isCreate */)); - // enable alteration of the default branch after clone - form.add(new DropDownChoice("defaultHead", repositoryModel.availableHeads)); + + // allow relinking HEAD to a branch or tag other than master on edit repository + List availableHeads = new ArrayList(); + if (!ArrayUtils.isEmpty(repositoryModel.availableHeads)) { + availableHeads.addAll(repositoryModel.availableHeads); + } + form.add(new DropDownChoice("defaultHead", availableHeads).setEnabled(!isCreate)); // federation strategies - remove ORIGIN choice if this repository has // no origin. -- 2.39.5