Merge branch 'mh/notes-cleanup' into next
authorJunio C Hamano <gitster@pobox.com>
Sun, 27 Aug 2017 06:01:30 +0000 (23:01 -0700)
committerJunio C Hamano <gitster@pobox.com>
Sun, 27 Aug 2017 06:01:30 +0000 (23:01 -0700)
Code clean-up.

* mh/notes-cleanup:
load_subtree(): declare some variables to be `size_t`
hex_to_bytes(): simpler replacement for `get_oid_hex_segment()`
get_oid_hex_segment(): don't pad the rest of `oid`
load_subtree(): combine some common code
get_oid_hex_segment(): return 0 on success
load_subtree(): only consider blobs to be potential notes
load_subtree(): check earlier whether an internal node is a tree entry
load_subtree(): separate logic for internal vs. terminal entries
load_subtree(): fix incorrect comment
load_subtree(): reduce the scope of some local variables
load_subtree(): remove unnecessary conditional
notes: make GET_NIBBLE macro more robust

1  2 
notes.c
diff --cc notes.c
index f090c88363883e65cea66fd63b2c8dfb3f642b7d,40d9ba62529ff3c47156d3e5a890055ed8678d44..7f5bfa19c7d49e09b54c5f5e2a6373dbb7451500
+++ b/notes.c
@@@ -421,11 -410,8 +410,8 @@@ static void load_subtree(struct notes_t
        void *buf;
        struct tree_desc desc;
        struct name_entry entry;
-       int len, path_len;
-       unsigned char type;
-       struct leaf_node *l;
  
 -      buf = fill_tree_descriptor(&desc, subtree->val_oid.hash);
 +      buf = fill_tree_descriptor(&desc, &subtree->val_oid);
        if (!buf)
                die("Could not read %s for notes-index",
                     oid_to_hex(&subtree->val_oid));