From 098bcda8640dbbe317aad6509e1dbc156d1ddd93 Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Thu, 22 Dec 2011 16:20:56 -0500
Subject: [PATCH] Improved readability of generated email notifications
---
src/com/gitblit/utils/JGitUtils.java | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/src/com/gitblit/utils/JGitUtils.java b/src/com/gitblit/utils/JGitUtils.java
index 31fd08f..e73ee80 100644
--- a/src/com/gitblit/utils/JGitUtils.java
+++ b/src/com/gitblit/utils/JGitUtils.java
@@ -471,6 +471,19 @@
}
/**
+ * 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.
*
--
Gitblit v1.9.1