From: James Moger Date: Thu, 4 Sep 2014 17:23:54 +0000 (-0400) Subject: Create email address for a user if unset for repo creation X-Git-Tag: v1.6.1~56^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Ftickets%2F49%2F149%2F1;p=gitblit.git Create email address for a user if unset for repo creation --- diff --git a/src/main/java/com/gitblit/wicket/pages/NewRepositoryPage.java b/src/main/java/com/gitblit/wicket/pages/NewRepositoryPage.java index 46877168..b6c23591 100644 --- a/src/main/java/com/gitblit/wicket/pages/NewRepositoryPage.java +++ b/src/main/java/com/gitblit/wicket/pages/NewRepositoryPage.java @@ -59,6 +59,7 @@ import com.gitblit.wicket.panels.AccessPolicyPanel; 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 { @@ -243,7 +244,8 @@ public class NewRepositoryPage extends RootSubPage { 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();