• Mike Hommey's avatar
    notes: allow treeish expressions as notes ref · ee76f92f
    Mike Hommey authored
    init_notes() is the main point of entry to the notes API. It ensures
    that the input can be used as ref, because it needs a ref to update to
    store notes tree after modifying it.
    
    There however are many use cases where notes tree is only read, e.g.
    "git log --notes=...".  Any notes-shaped treeish could be used for such
    purpose, but it is not allowed due to existing restriction.
    
    Allow treeish expressions to be used in the case the notes tree is going
    to be used without write "permissions".  Add a flag to distinguish
    whether the notes tree is intended to be used read-only, or will be
    updated.
    
    With this change, operations that use notes read-only can be fed any
    notes-shaped tree-ish can be used, e.g. git log --notes=notes@{1}.
    Signed-off-by: default avatarMike Hommey <mh@glandium.org>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    ee76f92f
notes-cache.c 2.19 KB