diff --git a/notes.c b/notes.c
index 0a128f1de9..ac58055c7a 100644
--- a/notes.c
+++ b/notes.c
@@ -422,11 +422,6 @@ static void load_subtree(struct notes_tree *t, struct leaf_node *subtree,
 
 		if (path_len == 2 * (hashsz - 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 (hex_to_bytes(object_oid.hash + prefix_len, entry.path,
 					 hashsz - prefix_len))
 				goto handle_non_note; /* entry.path is not a SHA1 */
@@ -735,6 +730,7 @@ struct write_each_note_data {
 	struct tree_write_stack *root;
 	struct non_note **nn_list;
 	struct non_note *nn_prev;
+	unsigned int note_mode;
 };
 
 static int write_each_non_note_until(const char *note_path,
@@ -766,7 +762,7 @@ static int write_each_note(const struct object_id *object_oid UNUSED,
 	struct write_each_note_data *d =
 		(struct write_each_note_data *) cb_data;
 	size_t note_path_len = strlen(note_path);
-	unsigned int mode = 0100644;
+	unsigned int mode = d->note_mode;
 
 	if (note_path[note_path_len - 1] == '/') {
 		/* subtree entry */
@@ -1190,7 +1186,10 @@ int for_each_note(struct notes_tree *t, int flags, each_note_fn fn,
 	return for_each_note_helper(t, t->root, 0, 0, flags, fn, cb_data);
 }
 
-int write_notes_tree(struct notes_tree *t, struct object_id *result)
+int write_notes_tree_mode(struct notes_tree *t, struct object_id *result,
+                          unsigned int mode);
+int write_notes_tree_mode(struct notes_tree *t, struct object_id *result,
+                          unsigned int mode)
 {
 	struct tree_write_stack root;
 	struct write_each_note_data cb_data;
@@ -1208,6 +1207,7 @@ int write_notes_tree(struct notes_tree *t, struct object_id *result)
 	cb_data.root = &root;
 	cb_data.nn_list = &(t->first_non_note);
 	cb_data.nn_prev = NULL;
+	cb_data.note_mode = mode;
 
 	/* Write tree objects representing current notes tree */
 	flags = FOR_EACH_NOTE_DONT_UNPACK_SUBTREES |
@@ -1220,6 +1220,11 @@ int write_notes_tree(struct notes_tree *t, struct object_id *result)
 	return ret;
 }
 
+int write_notes_tree(struct notes_tree *t, struct object_id *result)
+{
+	return write_notes_tree_mode(t, result, 0100644);
+}
+
 void prune_notes(struct notes_tree *t, int flags)
 {
 	struct note_delete_list *l = NULL;
