summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2011-12-22 16:20:56 -0500
committerJames Moger <james.moger@gitblit.com>2011-12-22 16:20:56 -0500
commit098bcda8640dbbe317aad6509e1dbc156d1ddd93 (patch)
tree115051f29e7c7099c647b2c9b7fd7669716fd1e5 /src/com
parentdcf57518555f7a8874533da047f3efaf7330a90a (diff)
downloadgitblit-098bcda8640dbbe317aad6509e1dbc156d1ddd93.tar.gz
gitblit-098bcda8640dbbe317aad6509e1dbc156d1ddd93.zip
Improved readability of generated email notifications
Diffstat (limited to 'src/com')
-rw-r--r--src/com/gitblit/utils/JGitUtils.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/com/gitblit/utils/JGitUtils.java b/src/com/gitblit/utils/JGitUtils.java
index 31fd08ff..e73ee800 100644
--- a/src/com/gitblit/utils/JGitUtils.java
+++ b/src/com/gitblit/utils/JGitUtils.java
@@ -471,6 +471,19 @@ public class JGitUtils {
}
/**
+ * Retrieves a Java Date from a Git commit.
+ *
+ * @param commit
+ * @return date of the commit or Date(0) if the commit is null
+ */
+ public static Date getAuthorDate(RevCommit commit) {
+ if (commit == null) {
+ return new Date(0);
+ }
+ return commit.getAuthorIdent().getWhen();
+ }
+
+ /**
* Returns the specified commit from the repository. If the repository does
* not exist or is empty, null is returned.
*