diff options
author | James Moger <james.moger@gitblit.com> | 2013-06-24 09:36:19 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2013-06-24 09:36:19 -0400 |
commit | 79dd0bddbd939c85f002f3a33b95ae84d0bf38cb (patch) | |
tree | b72b140a2af157ed878178ba7022c2eacae12a67 /src/main/java/com/gitblit/models/RefLogEntry.java | |
parent | 03232453be7624bc2fc8a942e8c280353606fe8b (diff) | |
download | gitblit-79dd0bddbd939c85f002f3a33b95ae84d0bf38cb.tar.gz gitblit-79dd0bddbd939c85f002f3a33b95ae84d0bf38cb.zip |
Implemented commit cache for the dashboards, activity, and project pages
Diffstat (limited to 'src/main/java/com/gitblit/models/RefLogEntry.java')
-rw-r--r-- | src/main/java/com/gitblit/models/RefLogEntry.java | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/main/java/com/gitblit/models/RefLogEntry.java b/src/main/java/com/gitblit/models/RefLogEntry.java index 54d17771..79e8a2ca 100644 --- a/src/main/java/com/gitblit/models/RefLogEntry.java +++ b/src/main/java/com/gitblit/models/RefLogEntry.java @@ -160,7 +160,24 @@ public class RefLogEntry implements Serializable, Comparable<RefLogEntry> { }
return null;
}
-
+
+ /**
+ * Adds a commit to the push entry object as long as the commit is not a
+ * duplicate.
+ *
+ * @param branch
+ * @param commit
+ * @return a RepositoryCommit, if one was added. Null if this is duplicate
+ * commit
+ */
+ public RepositoryCommit addCommit(RepositoryCommit commit) {
+ if (commits.add(commit)) {
+ authorCount = -1;
+ return commit;
+ }
+ return null;
+ }
+
/**
* Adds a a list of repository commits. This is used to construct discrete
* ref push log entries
|