[PATCH 5/6] Assume a note ref starting with refs must not be prepended refs/notes/.
- From
- Yann Dirson <ydirson@free.fr>
- Date
- Jun 18, 2011, 21:06 UTC
- Message-ID
- <1308431208-13353-6-git-send-email-ydirson@free.fr>
- In-Reply-To
- <1308431208-13353-1-git-send-email-ydirson@free.fr>
This caused strange behaviour when "git notes" was asked to manipulate refs/<anything> outside of refs/notes/: it was attempting to use refs/notes/refs/<anything>.
Dying early this way should avoid the need to check for the refs/notes/ prefix in several places.
Signed-off-by: Yann Dirson <ydirson@free.fr> --- notes.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/notes.c b/notes.c index 12afc02..c6a82da 100644 --- a/notes.c +++ b/notes.c @@ -1289,6 +1289,8 @@ void expand_notes_ref(struct strbuf *sb, int allow_remotes) return; /* we're happy */ else if (!prefixcmp(sb->buf, "notes/")) strbuf_insert(sb, 0, "refs/", 5); + else if (!prefixcmp(sb->buf, "refs/")) + die(_("Not a notes reference: %s"), sb->buf); else strbuf_insert(sb, 0, "refs/notes/", 11); }
-- 1.7.5.3