Skip to content
  • Jeff King's avatar
    sha1_file_name(): overwrite buffer instead of appending · b69fb867
    Jeff King authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    The sha1_file_name() function is used to generate the path to a loose
    object in the object directory. It doesn't make much sense for it to
    append, since the the path we write may be absolute (i.e., you cannot
    reliably build up a path with it). Because many callers use it with a
    static buffer, they have to strbuf_reset() manually before each call
    (and the other callers always use an empty buffer, so they don't care
    either way). Let's handle this automatically.
    
    Since we're changing the semantics, let's take the opportunity to give
    it a more hash-neutral name (which will also catch any callers from
    topics in flight).
    
    Signed-off-by: default avatarJeff King <peff@peff.net>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    b69fb867