aboutsummaryrefslogtreecommitdiff
path: root/notes.c
diff options
context:
space:
mode:
Diffstat (limited to 'notes.c')
-rw-r--r--notes.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/notes.c b/notes.c
index 61a5001fc..8bca18edb 100644
--- a/notes.c
+++ b/notes.c
@@ -437,6 +437,11 @@ static void load_subtree(struct notes_tree *t, struct leaf_node *subtree,
if (path_len == 2 * (GIT_SHA1_RAWSZ - prefix_len)) {
/* This is potentially the remainder of the SHA-1 */
+
+ if (!S_ISREG(entry.mode))
+ /* notes must be blobs */
+ goto handle_non_note;
+
if (get_oid_hex_segment(entry.path, path_len,
object_oid.hash + prefix_len,
GIT_SHA1_RAWSZ - prefix_len) < 0)