refs/heads/x -> x etc. Signed-off-by: Robin Rosenberg <robin.rosenberg@xxxxxxxxxx> --- .../src/org/spearce/jgit/lib/Repository.java | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java b/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java index 9bed1b7..55dae27 100644 --- a/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java +++ b/org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java @@ -1074,4 +1074,19 @@ public void scanForRepoChanges() throws IOException { getAllRefs(); // This will look for changes to refs getIndex(); // This will detect changes in the index } + + /** + * @param refName + * + * @return a more user friendly ref name + */ + public String shortenRefName(String refName) { + if (refName.startsWith(Constants.R_HEADS)) + return refName.substring(Constants.R_HEADS.length()); + if (refName.startsWith(Constants.R_TAGS)) + return refName.substring(Constants.R_TAGS.length()); + if (refName.startsWith(Constants.R_REMOTES)) + return refName.substring(Constants.R_REMOTES.length()); + return refName; + } } -- 1.6.3.dirty -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html