Author: adietish
Date: 2011-08-19 12:22:44 -0400 (Fri, 19 Aug 2011)
New Revision: 34095
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/EGitUtils.java
Log:
[JBIDE-9513] implementing push test
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/EGitUtils.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/EGitUtils.java 2011-08-19
14:12:32 UTC (rev 34094)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/EGitUtils.java 2011-08-19
16:22:44 UTC (rev 34095)
@@ -69,8 +69,8 @@
null,
null,
null,
- getSubject(userConfig.getAuthorName(), userConfig.getAuthorEmail()),
- getSubject(userConfig.getCommitterName(), userConfig.getCommitterEmail()),
+ getFormattedUser(userConfig.getAuthorName(), userConfig.getAuthorEmail()),
+ getFormattedUser(userConfig.getCommitterName(), userConfig.getCommitterEmail()),
"Initial commit");
op.setCommitAll(true);
op.setRepository(repository);
@@ -205,17 +205,28 @@
}
/**
- * Gets the UserConfig from the given repository
+ * Gets the UserConfig from the given repository. The UserConfig of a repo
+ * holds the default author and committer.
*
* @param repository
* the repository
- * @return the user config
+ * @return the user configuration
+ * @throws CoreException
+ *
+ * @see PersonIdent(Repository)
+ * @see CommittHelper#calculateCommitInfo
*/
- private static UserConfig getUserConfig(Repository repository) {
+ private static UserConfig getUserConfig(Repository repository) throws CoreException {
+ if (repository.getConfig() == null) {
+ IStatus status = new Status(IStatus.ERROR, EGitCoreActivator.PLUGIN_ID,
+ NLS.bind("no user configuration (author, committer) are present in repository
\"{0}\"",
+ repository.toString()));
+ throw new CoreException(status);
+ }
return repository.getConfig().get(UserConfig.KEY);
}
- private static String getSubject(String name, String email) {
+ private static String getFormattedUser(String name, String email) {
return new StringBuilder().append(name).append("
<").append(email).append('>').toString();
}
Show replies by date