]> source.dussan.org Git - gitblit.git/commitdiff
Fixed bug in repository creation related to relinking head feature
authorJames Moger <james.moger@gitblit.com>
Fri, 3 Feb 2012 00:10:21 +0000 (19:10 -0500)
committerJames Moger <james.moger@gitblit.com>
Fri, 3 Feb 2012 00:10:21 +0000 (19:10 -0500)
src/com/gitblit/wicket/pages/EditRepositoryPage.java

index a16d7e40318ceffe30dfc9a5c065efb762a8f677..ec52aaf88e615f52eb6b2d3e449dac3c985e0967 100644 (file)
@@ -271,8 +271,13 @@ public class EditRepositoryPage extends RootSubPage {
                form.add(new CheckBox("isFrozen"));\r
                // TODO enable origin definition\r
                form.add(new TextField<String>("origin").setEnabled(false/* isCreate */));\r
-               // enable alteration of the default branch after clone\r
-               form.add(new DropDownChoice<String>("defaultHead", repositoryModel.availableHeads));\r
+               \r
+               // allow relinking HEAD to a branch or tag other than master on edit repository\r
+               List<String> availableHeads = new ArrayList<String>();\r
+               if (!ArrayUtils.isEmpty(repositoryModel.availableHeads)) {\r
+                       availableHeads.addAll(repositoryModel.availableHeads);\r
+               }\r
+               form.add(new DropDownChoice<String>("defaultHead", availableHeads).setEnabled(!isCreate));\r
 \r
                // federation strategies - remove ORIGIN choice if this repository has\r
                // no origin.\r