• M
    update_refs(): fix constness · 595deb8d
    Michael Haggerty 提交于
    The old signature of update_refs() required a
    (const struct ref_update **) for its updates_orig argument.  The
    "const" is presumably there to promise that the function will not
    modify the contents of the structures.
    
    But this declaration does not permit the function to be called with a
    (struct ref_update **), which is perfectly legitimate.  C's type
    system is not powerful enough to express what we'd like.  So remove
    the first "const" from the declaration.
    
    On the other hand, the function *can* promise not to modify the
    pointers within the array that is passed to it without inconveniencing
    its callers.  So add a "const" that has that effect, making the final
    declaration
    (struct ref_update * const *).
    Signed-off-by: NMichael Haggerty <mhagger@alum.mit.edu>
    Signed-off-by: NJunio C Hamano <gitster@pobox.com>
    595deb8d
refs.c 93.1 KB