From: James Moger Date: Fri, 3 Feb 2012 00:10:21 +0000 (-0500) Subject: Fixed bug in repository creation related to relinking head feature X-Git-Tag: v0.9.0~117 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ddbf6701b4df04d2c7a84080dfb4d64ef9d3f7a0;p=gitblit.git Fixed bug in repository creation related to relinking head feature --- 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.