• J
    test-lib: Introduce test_chmod and use it instead of update-index --chmod · 1f553918
    Johannes Sixt 提交于
    This function replaces sequences of 'chmod +x' and 'git update-index
    --chmod=+x' in the test suite, whose purpose is to help filesystems
    that need core.filemode=false. Two places where only 'chmod +x' was used
    we also use this new function.
    
    The function calls 'git update-index --chmod' without checking
    core.filemode (unlike some of the call sites did). We do this because the
    call sites *expect* that the executable bit ends up in the index (ie. it
    is not the purpose of the call sites to *test* whether git treats
    'chmod +x' and 'update-index --chmod=+x' correctly). Therefore, on
    filesystems with core.filemode=true the 'git update-index --chmod' is a
    no-op.
    
    The function uses --add with update-index to help one call site in
    t6031-merge-recursive. It makes no difference for the other callers.
    Signed-off-by: NJohannes Sixt <j6t@kdbg.org>
    1f553918
test-lib.sh 14.5 KB