aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/UserConfig.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/UserConfig.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/UserConfig.java
index 60b4819eda..60ac6f176d 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/UserConfig.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/UserConfig.java
@@ -180,7 +180,7 @@ public class UserConfig {
username = system().getenv(envKey);
}
- return username;
+ return stripInvalidCharacters(username);
}
/**
@@ -204,7 +204,11 @@ public class UserConfig {
email = system().getenv(envKey);
}
- return email;
+ return stripInvalidCharacters(email);
+ }
+
+ private static String stripInvalidCharacters(String s) {
+ return s == null ? null : s.replaceAll("<|>|\n", ""); //$NON-NLS-1$//$NON-NLS-2$
}
/**