Skip to content
  • Junio C Hamano's avatar
    diff: do not short-cut CHECK_SIZE_ONLY check in diff_populate_filespec() · 12426e11
    Junio C Hamano authored
    
    
    Callers of diff_populate_filespec() can choose to ask only for the
    size of the blob without grabbing the blob data, and the function,
    after running lstat() when the filespec points at a working tree
    file, returns by copying the value in size field of the stat
    structure into the size field of the filespec when this is the case.
    
    However, this short-cut cannot be taken if the contents from the
    path needs to go through convert_to_git(), whose resulting real blob
    data may be different from what is in the working tree file.
    
    As "git diff --quiet" compares the .size fields of filespec
    structures to skip content comparison, this bug manifests as a
    false "there are differences" for a file that needs eol conversion,
    for example.
    
    Reported-by: default avatarMike Crowe <mac@mcrowe.com>
    Helped-by: default avatarTorsten Bögershausen <tboegi@web.de>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    12426e11