summaryrefslogtreecommitdiff
path: root/t/helper/test-submodule-nested-repo-config.c
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2024-03-28 19:02:30 +0100
committerJohannes Schindelin <johannes.schindelin@gmx.de>2024-04-17 22:30:09 +0200
commit48c171d927407132875283db3afb05b08b98a078 (patch)
tree5ee58acfe7fda13ae2e230bb97b3cc83e97794d5 /t/helper/test-submodule-nested-repo-config.c
parent31572dc420afee36db8fbbbe060dd78c9a48778c (diff)
find_hook(): refactor the `STRIP_EXTENSION` logic
When looking for a hook and not finding one, and when `STRIP_EXTENSION` is available (read: if we're on Windows and `.exe` is the required extension for executable programs), we want to look also for a hook with that extension. Previously, we added that handling into the conditional block that was meant to handle when no hook was found (possibly providing some advice for the user's benefit). If the hook with that file extension was found, we'd return early from that function instead of writing out said advice, of course. However, we're about to introduce a safety valve to prevent hooks from being run during a clone, to reduce the attack surface of bugs that allow writing files to be written into arbitrary locations. To prepare for that, refactor the logic to avoid the early return, by separating the `STRIP_EXTENSION` handling from the conditional block handling the case when no hook was found. This commit is best viewed with `--patience`. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Diffstat (limited to 't/helper/test-submodule-nested-repo-config.c')
0 files changed, 0 insertions, 0 deletions