From 836b117469265beb26e24ff4221aaa6ed64bcdc6 Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Wed, 04 Jan 2012 20:14:32 -0500
Subject: [PATCH] Fixed wrong include folder to make GO monotlihic (issue 30)
---
src/com/gitblit/utils/JGitUtils.java | 22 +++++++++++++++++++++-
1 files changed, 21 insertions(+), 1 deletions(-)
diff --git a/src/com/gitblit/utils/JGitUtils.java b/src/com/gitblit/utils/JGitUtils.java
index 31fd08f..d694ee2 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.
*
@@ -988,7 +1001,14 @@
RevWalk rw = new RevWalk(repository);
rw.markStart(rw.parseCommit(endRange));
- rw.markUninteresting(rw.parseCommit(startRange));
+ if (startRange.equals(ObjectId.zeroId())) {
+ // maybe this is a tag or an orphan branch
+ list.add(rw.parseCommit(endRange));
+ rw.dispose();
+ return list;
+ } else {
+ rw.markUninteresting(rw.parseCommit(startRange));
+ }
Iterable<RevCommit> revlog = rw;
for (RevCommit rev : revlog) {
--
Gitblit v1.9.1