summaryrefslogtreecommitdiffstats
path: root/src/com/gitblit/models
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2012-12-07 08:24:43 -0500
committerJames Moger <james.moger@gitblit.com>2012-12-07 08:24:43 -0500
commitac7e9a61460554aa0183c677bb15d1f473519f55 (patch)
tree7be13095f8b4e04b810cbc7af9d7b1444b09b432 /src/com/gitblit/models
parentdab13a996adbfbc4086be6ff96836e590f7d339c (diff)
downloadgitblit-ac7e9a61460554aa0183c677bb15d1f473519f55.tar.gz
gitblit-ac7e9a61460554aa0183c677bb15d1f473519f55.zip
Harden metrics from polluted data (issue-176)
Diffstat (limited to 'src/com/gitblit/models')
-rw-r--r--src/com/gitblit/models/Activity.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/com/gitblit/models/Activity.java b/src/com/gitblit/models/Activity.java
index 771c8a1a..7e0cb4b3 100644
--- a/src/com/gitblit/models/Activity.java
+++ b/src/com/gitblit/models/Activity.java
@@ -28,6 +28,7 @@ import java.util.Set;
import org.eclipse.jgit.lib.PersonIdent;
import org.eclipse.jgit.revwalk.RevCommit;
+import com.gitblit.utils.StringUtils;
import com.gitblit.utils.TimeUtils;
/**
@@ -93,8 +94,7 @@ public class Activity implements Serializable, Comparable<Activity> {
}
repositoryMetrics.get(repository).count++;
- String author = commit.getAuthorIdent().getEmailAddress()
- .toLowerCase();
+ String author = StringUtils.removeNewlines(commit.getAuthorIdent().getEmailAddress()).toLowerCase();
if (!authorMetrics.containsKey(author)) {
authorMetrics.put(author, new Metric(author));
}