Paul Martin
2016-04-27 c2188a840bc4153ae92112b04b2e06a90d3944aa
src/main/java/com/gitblit/wicket/pages/NewRepositoryPage.java
@@ -56,9 +56,10 @@
import com.gitblit.wicket.GitBlitWebSession;
import com.gitblit.wicket.WicketUtils;
import com.gitblit.wicket.panels.AccessPolicyPanel;
import com.gitblit.wicket.panels.CheckboxOption;
import com.gitblit.wicket.panels.ConditionalChoiceOption;
import com.gitblit.wicket.panels.BooleanChoiceOption;
import com.gitblit.wicket.panels.BooleanOption;
import com.gitblit.wicket.panels.RepositoryNamePanel;
import com.google.common.base.Optional;
public class NewRepositoryPage extends RootSubPage {
@@ -142,7 +143,6 @@
            } catch (GitBlitException e) {
               error(e.getMessage());
               namePanel.resetModel(repositoryModel);
               return;
            }
            setRedirect(true);
@@ -181,7 +181,7 @@
      // add README
      addReadmeModel = Model.of(false);
      form.add(new CheckboxOption("addReadme",
      form.add(new BooleanOption("addReadme",
            getString("gb.initWithReadme"),
            getString("gb.initWithReadmeDescription"),
            addReadmeModel));
@@ -202,7 +202,7 @@
      gitignoreModel = Model.of("");
      addGitignoreModel = Model.of(false);
      form.add(new ConditionalChoiceOption<String>("addGitIgnore",
      form.add(new BooleanChoiceOption<String>("addGitIgnore",
            getString("gb.initWithGitignore"),
            getString("gb.initWithGitignoreDescription"),
            addGitignoreModel,
@@ -211,7 +211,7 @@
      // TODO consider gitflow at creation (ticket-55)
      addGitflowModel = Model.of(false);
      form.add(new CheckboxOption("addGitFlow",
      form.add(new BooleanOption("addGitFlow",
            "Include a .gitflow file",
            "This will generate a config file which guides Git clients in setting up Gitflow branches.",
            addGitflowModel).setVisible(false));
@@ -244,7 +244,8 @@
      try {
         UserModel user = GitBlitWebSession.get().getUser();
         PersonIdent author = new PersonIdent(user.getDisplayName(), user.emailAddress);
         String email = Optional.fromNullable(user.emailAddress).or(user.username + "@" + "gitblit");
         PersonIdent author = new PersonIdent(user.getDisplayName(), email);
         DirCache newIndex = DirCache.newInCore();
         DirCacheBuilder indexBuilder = newIndex.builder();
@@ -358,14 +359,14 @@
               }
            }
         } finally {
            revWalk.release();
            revWalk.close();
         }
      } catch (UnsupportedEncodingException e) {
         logger().error(null, e);
      } catch (IOException e) {
         logger().error(null, e);
      } finally {
         odi.release();
         odi.close();
         db.close();
      }
      return success;