+ int path_len = strlen(entry.path);
+
+ if (path_len == 2 * (GIT_SHA1_RAWSZ - prefix_len)) {
+ /* This is potentially the remainder of the SHA-1 */
+ if (get_oid_hex_segment(entry.path, path_len,
+ object_oid.hash + prefix_len,
+ GIT_SHA1_RAWSZ - prefix_len) < 0)
+ goto handle_non_note; /* entry.path is not a SHA1 */
+
+ type = PTR_TYPE_NOTE;
+ l = (struct leaf_node *)
+ xcalloc(1, sizeof(struct leaf_node));
+ oidcpy(&l->key_oid, &object_oid);
+ oidcpy(&l->val_oid, entry.oid);
+ } else if (path_len == 2) {
+ /* This is potentially an internal node */
+ if (get_oid_hex_segment(entry.path, 2,
+ object_oid.hash + prefix_len,
+ GIT_SHA1_RAWSZ - prefix_len) < 0)
+ goto handle_non_note; /* entry.path is not a SHA1 */