diff options
author | James Moger <james.moger@gitblit.com> | 2014-09-04 13:23:54 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2014-09-04 13:23:54 -0400 |
commit | 2da1f2eae6354bae394e9513ddc1d66cdc13c7cb (patch) | |
tree | 3a328050cb6d6bc17a8cbbef29c784feecdbf397 /src/main | |
parent | 16e1542465bf7dfd89c02299d9bd47a3be15209e (diff) | |
download | gitblit-2da1f2eae6354bae394e9513ddc1d66cdc13c7cb.tar.gz gitblit-2da1f2eae6354bae394e9513ddc1d66cdc13c7cb.zip |
Create email address for a user if unset for repo creation
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/com/gitblit/wicket/pages/NewRepositoryPage.java | 4 |
1 files changed, 3 insertions, 1 deletions
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();
|