diff options
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/notes/NoteMap.java')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/notes/NoteMap.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/notes/NoteMap.java b/org.eclipse.jgit/src/org/eclipse/jgit/notes/NoteMap.java index 0d4d6b9147..3c4347823b 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/notes/NoteMap.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/notes/NoteMap.java @@ -81,6 +81,19 @@ public class NoteMap implements Iterable<Note> { } /** + * Shorten the note ref name by trimming off the {@link Constants#R_NOTES} + * prefix if it exists. + * + * @param noteRefName + * @return a more user friendly note name + */ + public static String shortenRefName(String noteRefName) { + if (noteRefName.startsWith(Constants.R_NOTES)) + return noteRefName.substring(Constants.R_NOTES.length()); + return noteRefName; + } + + /** * Load a collection of notes from a branch. * * @param reader |