From 2da1f2eae6354bae394e9513ddc1d66cdc13c7cb Mon Sep 17 00:00:00 2001 From: James Moger Date: Thu, 4 Sep 2014 13:23:54 -0400 Subject: [PATCH] Create email address for a user if unset for repo creation --- src/main/java/com/gitblit/wicket/pages/NewRepositoryPage.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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(); -- 2.39.5