]> source.dussan.org Git - gitblit.git/commitdiff
Create email address for a user if unset for repo creation 49/149/1
authorJames Moger <james.moger@gitblit.com>
Thu, 4 Sep 2014 17:23:54 +0000 (13:23 -0400)
committerJames Moger <james.moger@gitblit.com>
Thu, 4 Sep 2014 17:23:54 +0000 (13:23 -0400)
src/main/java/com/gitblit/wicket/pages/NewRepositoryPage.java

index 4687716831bcf7590de4b9e6cc88279f8ceb8652..b6c2359133c65eb8226efc11e58496d07c33051c 100644 (file)
@@ -59,6 +59,7 @@ import com.gitblit.wicket.panels.AccessPolicyPanel;
 import com.gitblit.wicket.panels.BooleanChoiceOption;\r
 import com.gitblit.wicket.panels.BooleanOption;\r
 import com.gitblit.wicket.panels.RepositoryNamePanel;\r
+import com.google.common.base.Optional;\r
 \r
 public class NewRepositoryPage extends RootSubPage {\r
 \r
@@ -243,7 +244,8 @@ public class NewRepositoryPage extends RootSubPage {
                try {\r
 \r
                        UserModel user = GitBlitWebSession.get().getUser();\r
-                       PersonIdent author = new PersonIdent(user.getDisplayName(), user.emailAddress);\r
+                       String email = Optional.fromNullable(user.emailAddress).or(user.username + "@" + "gitblit");\r
+                       PersonIdent author = new PersonIdent(user.getDisplayName(), email);\r
 \r
                        DirCache newIndex = DirCache.newInCore();\r
                        DirCacheBuilder indexBuilder = newIndex.builder();\r