• 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
    With this change, operations that use notes read-only can be fed any
    notes-shaped tree-ish can be used, e.g. git log [email protected]{1}.
    Signed-off-by: default avatarMike Hommey <[email protected]>
    Signed-off-by: default avatarJunio C Hamano <[email protected]>
notes.h 11.5 KB