summaryrefslogtreecommitdiffstats
path: root/src/com/gitblit/wicket/pages/EditRepositoryPage.java
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2012-02-02 19:10:21 -0500
committerJames Moger <james.moger@gitblit.com>2012-02-02 19:10:21 -0500
commitddbf6701b4df04d2c7a84080dfb4d64ef9d3f7a0 (patch)
tree676df16aea35a849eb73ad19f3bd0e81f17deaf8 /src/com/gitblit/wicket/pages/EditRepositoryPage.java
parentf2da4a9911f1b60283842c8a0ce9a3bb58227b19 (diff)
downloadgitblit-ddbf6701b4df04d2c7a84080dfb4d64ef9d3f7a0.tar.gz
gitblit-ddbf6701b4df04d2c7a84080dfb4d64ef9d3f7a0.zip
Fixed bug in repository creation related to relinking head feature
Diffstat (limited to 'src/com/gitblit/wicket/pages/EditRepositoryPage.java')
-rw-r--r--src/com/gitblit/wicket/pages/EditRepositoryPage.java9
1 files 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<String>("origin").setEnabled(false/* isCreate */));
- // enable alteration of the default branch after clone
- form.add(new DropDownChoice<String>("defaultHead", repositoryModel.availableHeads));
+
+ // allow relinking HEAD to a branch or tag other than master on edit repository
+ List<String> availableHeads = new ArrayList<String>();
+ if (!ArrayUtils.isEmpty(repositoryModel.availableHeads)) {
+ availableHeads.addAll(repositoryModel.availableHeads);
+ }
+ form.add(new DropDownChoice<String>("defaultHead", availableHeads).setEnabled(!isCreate));
// federation strategies - remove ORIGIN choice if this repository has
// no origin.