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