summaryrefslogtreecommitdiff
path: root/t/unit-tests/t-basic.c
diff options
context:
space:
mode:
authorChandra Pratap <chandrapratap3519@gmail.com>2023-12-26 15:32:16 -0800
committerJunio C Hamano <gitster@pobox.com>2023-12-26 21:20:32 -0800
commit0482c32c334b046ff2dd2190c026cfd4ec564233 (patch)
treecbed3dd64531f6f842004efa82444ee928731845 /t/unit-tests/t-basic.c
parent564d0252ca632e0264ed670534a51d18a689ef5d (diff)
apply: ignore working tree filemode when !core.filemode
When applying a patch that adds an executable file, git apply ignores the core.fileMode setting (core.fileMode in git config specifies whether the executable bit on files in the working tree should be honored or not) resulting in warnings like: warning: script.sh has type 100644, expected 100755 even when core.fileMode is set to false, which is undesired. This is extra true for systems like Windows. Fix this by inferring the correct file mode from either the existing index entry, and when it is unavailable, assuming that the file mode was OK by pretending it had the mode that the preimage wants to see, when core.filemode is set to false. Add a test case that verifies the change and prevents future regression. Signed-off-by: Chandra Pratap <chandrapratap3519@gmail.com> Reviewed-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/unit-tests/t-basic.c')
0 files changed, 0 insertions, 0 deletions