• J
    diff: do not short-cut CHECK_SIZE_ONLY check in diff_populate_filespec() · 12426e11
    Junio C Hamano 提交于
    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: NMike Crowe <mac@mcrowe.com>
    Helped-by: NTorsten Bögershausen <tboegi@web.de>
    Signed-off-by: NJunio C Hamano <gitster@pobox.com>
    12426e11
t4035-diff-quiet.sh 4.9 KB