Skip to content
  • Duy Nguyen's avatar
    parse_object: avoid putting whole blob in core · 090ea126
    Duy Nguyen authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    Traditionally, all the callers of check_sha1_signature() first
    called read_sha1_file() to prepare the whole object data in core,
    and called this function.  The function is used to revalidate what
    we read from the object database actually matches the object name we
    used to ask for the data from the object database.
    
    Update the API to allow callers to pass NULL as the object data, and
    have the function read and hash the object data using streaming API
    to recompute the object name, without having to hold everything in
    core at the same time.  This is most useful in parse_object() that
    parses a blob object, because this caller does not have to keep the
    actual blob data around in memory after a "struct blob" is returned.
    
    Signed-off-by: default avatarNguyễn Thái Ngọc Duy <pclouds@gmail.com>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    090ea126