summaryrefslogtreecommitdiffstats
path: root/src/com/gitblit/utils/JGitUtils.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/gitblit/utils/JGitUtils.java')
-rw-r--r--src/com/gitblit/utils/JGitUtils.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/com/gitblit/utils/JGitUtils.java b/src/com/gitblit/utils/JGitUtils.java
index 5118425e..cd3e6efe 100644
--- a/src/com/gitblit/utils/JGitUtils.java
+++ b/src/com/gitblit/utils/JGitUtils.java
@@ -15,6 +15,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.util.concurrent.atomic.AtomicInteger;
import org.eclipse.jgit.diff.DiffEntry;
import org.eclipse.jgit.diff.DiffFormatter;
@@ -326,6 +327,17 @@ public class JGitUtils {
return list;
}
+ public static Map<ChangeType, AtomicInteger> getChangedPathsStats(List<PathChangeModel> paths) {
+ Map<ChangeType, AtomicInteger> stats = new HashMap<ChangeType, AtomicInteger>();
+ for (PathChangeModel path : paths) {
+ if (!stats.containsKey(path.changeType)) {
+ stats.put(path.changeType, new AtomicInteger(0));
+ }
+ stats.get(path.changeType).incrementAndGet();
+ }
+ return stats;
+ }
+
public static enum DiffOutputType {
PLAIN, GITWEB, GITBLIT;