Skip to content
  • Jeff King's avatar
    gc: replace local buffer with git_path · 07af8891
    Jeff King authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    We probe the "17/" loose object directory for auto-gc, and
    use a local buffer to format the path. We can just use
    git_path() for this. It handles paths of any length
    (reducing our error handling). And because we feed the
    result straight to a system call, we can just use the static
    variant.
    
    Note that git_path also knows the string "objects/" is
    special, and will replace it with git_object_directory()
    when necessary.
    
    Another alternative would be to use sha1_file_name() for the
    pretend object "170000...", but that ends up being more
    hassle for no gain, as we have to truncate the final path
    component.
    
    Signed-off-by: default avatarJeff King <peff@peff.net>
    07af8891