Skip to content
  • Junio C Hamano's avatar
    checkout_entry(): clarify the use of topath[] parameter · af2a651d
    Junio C Hamano authored
    
    
    The said function has this signature:
    
    	extern int checkout_entry(struct cache_entry *ce,
    				  const struct checkout *state,
    				  char *topath);
    
    At first glance, it might appear that the caller of checkout_entry()
    can specify to which path the contents are written out by the last
    parameter, and it is tempting to add "const" in front of its type.
    
    In reality, however, topath[] is to point at a buffer to store the
    temporary path generated by the callchain originating from this
    function, and the temporary path is always short, much shorter than
    the buffer prepared by its only caller in builtin/checkout-index.c.
    
    Document the code a bit to clarify so that future callers know how
    to use the function better.
    
    Noticed-by: default avatarNguyễn Thái Ngọc Duy <pclouds@gmail.com>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    af2a651d