From 9e186eedf1a09ca7ac4fbdea32b00e7e5331f7eb Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Sat, 05 Jan 2013 17:52:36 -0500
Subject: [PATCH] Updated documentation

---
 src/com/gitblit/utils/JGitUtils.java |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/src/com/gitblit/utils/JGitUtils.java b/src/com/gitblit/utils/JGitUtils.java
index 9cfb37f..099036e 100644
--- a/src/com/gitblit/utils/JGitUtils.java
+++ b/src/com/gitblit/utils/JGitUtils.java
@@ -1457,6 +1457,20 @@
 			int maxCount) {
 		return getRefs(repository, Constants.R_NOTES, fullName, maxCount);
 	}
+	
+	/**
+	 * Returns the list of refs in the specified base ref. If repository does 
+	 * not exist or is empty, an empty list is returned.
+	 * 
+	 * @param repository
+	 * @param fullName
+	 *            if true, /refs/yadayadayada is returned. If false,
+	 *            yadayadayada is returned.
+	 * @return list of refs
+	 */
+	public static List<RefModel> getRefs(Repository repository, String baseRef) {
+		return getRefs(repository, baseRef, true, -1);
+	}
 
 	/**
 	 * Returns a list of references in the repository matching "refs". If the
@@ -1528,7 +1542,7 @@
 		try {
 			// search for the branch in local heads
 			for (RefModel ref : JGitUtils.getLocalBranches(repository, false, -1)) {
-				if (ref.displayName.endsWith(name)) {
+				if (ref.reference.getName().endsWith(name)) {
 					branch = ref;
 					break;
 				}
@@ -1537,7 +1551,7 @@
 			// search for the branch in remote heads
 			if (branch == null) {
 				for (RefModel ref : JGitUtils.getRemoteBranches(repository, false, -1)) {
-					if (ref.displayName.endsWith(name)) {
+					if (ref.reference.getName().endsWith(name)) {
 						branch = ref;
 						break;
 					}

--
Gitblit v1.9.1