tests: assume the hooks are disabled by default
Stop moving the .git/hooks directory out of the way, or creating it during test setup. Instead assume that it will contain harmless *.sample files. That we can assume that is discussed in point #4 of f0d4d398e28 (test-lib: split up and deprecate test_create_repo(), 2021-05-10), those parts of this could and should have been done in that change. Removing the "mkdir -p" here will then validate that our templates are being used, since we'd subsequently fail to create a hook in that directory if it didn't exist. Subsequent commits will have those hooks created by a "test_hook" wrapper, which will then being doing that same validation. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ævar Arnfjörð Bjarmason committed
Mar 17, 2022 at 11:13 UTC
ee32abda28299bfb03e1c3239b95182579569012
3 files changed
+1
-5
t/t1416-ref-transaction-hooks.sh
-1
@@ -8,7 +8,6 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
8
. ./test-lib.sh
9
10
test_expect_success setup '
11
- mkdir -p .git/hooks &&
11
test_commit PRE &&
12
PRE_OID=$(git rev-parse PRE) &&
13
test_commit POST &&
t/t5516-fetch-push.sh
+1
-2
@@ -28,8 +28,7 @@ mk_empty () {
28
(
29
cd "$repo_name" &&
30
git init &&
31
- git config receive.denyCurrentBranch warn &&
32
- mv .git/hooks .git/hooks-disabled
31
+ git config receive.denyCurrentBranch warn
32
)
33
}
34
t/t7519-status-fsmonitor.sh
-2
@@ -56,7 +56,6 @@ test_lazy_prereq UNTRACKED_CACHE '
56
'
57
58
test_expect_success 'setup' '
59
- mkdir -p .git/hooks &&
59
: >tracked &&
60
: >modified &&
61
mkdir dir1 &&
@@ -322,7 +321,6 @@ test_expect_success UNTRACKED_CACHE 'ignore .git changes when invalidating UNTR'
321
test_create_repo dot-git &&
322
(
323
cd dot-git &&
325
- mkdir -p .git/hooks &&
324
: >tracked &&
325
test-tool chmtime =-60 tracked &&
326
: >modified &&