summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2015-02-27 01:54:12 +0100
committerMatthias Sohn <matthias.sohn@sap.com>2015-02-27 01:54:12 +0100
commit1350f7ea1d801b8e47f8c58779967b8e31881883 (patch)
treea7896bb744cbdcece4801d30745e742672efba33 /org.eclipse.jgit.test
parent102c50e177f398247452a68c7142dc1cf97532f1 (diff)
parent9b486e390625df6cb495f57012a0384753399ec8 (diff)
downloadjgit-1350f7ea1d801b8e47f8c58779967b8e31881883.tar.gz
jgit-1350f7ea1d801b8e47f8c58779967b8e31881883.zip
Merge branch 'stable-3.7'
* stable-3.7: Prepare 3.7.1-SNAPSHOT builds JGit v3.7.0.201502260915-r Read user.name and email from environment first Provide more details in exceptions thrown when packfile is invalid Change-Id: I427f861c6bc94da5e3e05dbbebbf0ad15719a323 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ConfigTest.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ConfigTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ConfigTest.java
index 69926f915d..db31fd34cd 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ConfigTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ConfigTest.java
@@ -186,6 +186,9 @@ public class ConfigTest {
assertFalse(localConfig.get(UserConfig.KEY).isAuthorEmailImplicit());
// the values are defined in the global configuration
+ // first clear environment variables since they would override
+ // configuration files
+ mockSystemReader.clearProperties();
userGitConfig.setString("user", null, "name", "global username");
userGitConfig.setString("user", null, "email", "author@globalemail");
authorName = localConfig.get(UserConfig.KEY).getAuthorName();
@@ -211,6 +214,20 @@ public class ConfigTest {
assertEquals("author@localemail", authorEmail);
assertFalse(localConfig.get(UserConfig.KEY).isCommitterNameImplicit());
assertFalse(localConfig.get(UserConfig.KEY).isCommitterEmailImplicit());
+
+ // also git environment variables are defined
+ mockSystemReader.setProperty(Constants.GIT_AUTHOR_NAME_KEY,
+ "git author name");
+ mockSystemReader.setProperty(Constants.GIT_AUTHOR_EMAIL_KEY,
+ "author@email");
+ localConfig.setString("user", null, "name", "local username");
+ localConfig.setString("user", null, "email", "author@localemail");
+ authorName = localConfig.get(UserConfig.KEY).getAuthorName();
+ authorEmail = localConfig.get(UserConfig.KEY).getAuthorEmail();
+ assertEquals("git author name", authorName);
+ assertEquals("author@email", authorEmail);
+ assertFalse(localConfig.get(UserConfig.KEY).isAuthorNameImplicit());
+ assertFalse(localConfig.get(UserConfig.KEY).isAuthorEmailImplicit());
}
@Test