Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[egit-dev] getHeaders bug patch

I am sending you the patch of my bug fix to start the review process as i have some issues with Gerrit Code Review server.
diff --git src/org/eclipse/jgit/lib/Repository.java src/org/eclipse/jgit/lib/Repository.java
index 6916a86..bc2ded2 100644
--- src/org/eclipse/jgit/lib/Repository.java
+++ src/org/eclipse/jgit/lib/Repository.java
@@ -791,6 +791,30 @@
 	}
 
 	/**
+	 * @return mutable map of all heads; key is short head name and value of the
+	 *         entry contains the ref with the full head name
+	 */
+	public Map<String, Ref> getHeads() {
+		try {
+			return getRefDatabase().getRefs(Constants.R_HEADS);
+		} catch (IOException e) {
+			return new HashMap<String, Ref>();
+		}
+	}
+
+	/**
+	 * @return mutable map of all remotes; key is short remote name and value of
+	 *         the entry contains the ref with the full remote name
+	 */
+	public Map<String, Ref> getRemotes() {
+		try {
+			return getRefDatabase().getRefs(Constants.R_REMOTES);
+		} catch (IOException e) {
+			return new HashMap<String, Ref>();
+		}
+	}
+
+	/**
 	 * @return mutable map of all tags; key is short tag name ("v1.0") and value
 	 *         of the entry contains the ref with the full tag name
 	 *         ("refs/tags/v1.0").

Back to the top