]> git.ipfire.org Git - thirdparty/git.git/blobdiff - notes.c
Merge branch 'es/submodule-fetch-message-fix'
[thirdparty/git.git] / notes.c
diff --git a/notes.c b/notes.c
index 0c79964c26a71d6843c43c94fe260131334749f2..a0349fa77831bcb79525e3f3a06132297857df87 100644 (file)
--- a/notes.c
+++ b/notes.c
@@ -1279,10 +1279,8 @@ static void format_note(struct notes_tree *t, const struct object_id *object_oid
                if (!ref || !strcmp(ref, GIT_NOTES_DEFAULT_REF)) {
                        strbuf_addstr(sb, "\nNotes:\n");
                } else {
-                       if (starts_with(ref, "refs/"))
-                               ref += 5;
-                       if (starts_with(ref, "notes/"))
-                               ref += 6;
+                       skip_prefix(ref, "refs/", &ref);
+                       skip_prefix(ref, "notes/", &ref);
                        strbuf_addf(sb, "\nNotes (%s):\n", ref);
                }
        }