Skip to content

Commit ee32abd

Browse files
avargitster
authored andcommitted
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 f0d4d39 (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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9494532 commit ee32abd

File tree

3 files changed

+1
-5
lines changed

3 files changed

+1
-5
lines changed

t/t1416-ref-transaction-hooks.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
88
. ./test-lib.sh
99

1010
test_expect_success setup '
11-
mkdir -p .git/hooks &&
1211
test_commit PRE &&
1312
PRE_OID=$(git rev-parse PRE) &&
1413
test_commit POST &&

t/t5516-fetch-push.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ mk_empty () {
2828
(
2929
cd "$repo_name" &&
3030
git init &&
31-
git config receive.denyCurrentBranch warn &&
32-
mv .git/hooks .git/hooks-disabled
31+
git config receive.denyCurrentBranch warn
3332
)
3433
}
3534

t/t7519-status-fsmonitor.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ test_lazy_prereq UNTRACKED_CACHE '
5656
'
5757

5858
test_expect_success 'setup' '
59-
mkdir -p .git/hooks &&
6059
: >tracked &&
6160
: >modified &&
6261
mkdir dir1 &&
@@ -322,7 +321,6 @@ test_expect_success UNTRACKED_CACHE 'ignore .git changes when invalidating UNTR'
322321
test_create_repo dot-git &&
323322
(
324323
cd dot-git &&
325-
mkdir -p .git/hooks &&
326324
: >tracked &&
327325
test-tool chmtime =-60 tracked &&
328326
: >modified &&

0 commit comments

Comments
 (0)