summaryrefslogtreecommitdiff
path: root/t/t0301-credential-cache.sh
diff options
context:
space:
mode:
authorSZEDER Gábor <szeder.dev@gmail.com>2019-03-13 13:24:14 +0100
committerJunio C Hamano <gitster@pobox.com>2019-03-14 12:34:39 +0900
commit3bc2702b883030b138a8c7585d7bc9adb4b4a399 (patch)
treef7ef7e68ec29048b40e71c9e2a842db311f47e20 /t/t0301-credential-cache.sh
parent8c3b9f7faa4f39ddb89be229b706d4a9f9c659a4 (diff)
downloadgit-3bc2702b883030b138a8c7585d7bc9adb4b4a399.tar.gz
t0301-credential-cache: use 'test_atexit' to stop the credentials helper
Use 'test_atexit' to run cleanup commands to stop the credentials helper at the end of the test script or upon interrupt or failure, as it is shorter, simpler, and more robust than registering such cleanup commands in the trap on EXIT in the test scripts. Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t0301-credential-cache.sh')
-rwxr-xr-xt/t0301-credential-cache.sh7
1 files changed, 1 insertions, 6 deletions
diff --git a/t/t0301-credential-cache.sh b/t/t0301-credential-cache.sh
index fd92533acf..ebd5fa5249 100755
--- a/t/t0301-credential-cache.sh
+++ b/t/t0301-credential-cache.sh
@@ -10,7 +10,7 @@ test -z "$NO_UNIX_SOCKETS" || {
}
# don't leave a stale daemon running
-trap 'code=$?; git credential-cache exit; (exit $code); die' EXIT
+test_atexit 'git credential-cache exit'
# test that the daemon works with no special setup
helper_test cache
@@ -108,9 +108,4 @@ test_expect_success SYMLINKS 'use user socket if user directory is a symlink to
helper_test_timeout cache --timeout=1
-# we can't rely on our "trap" above working after test_done,
-# as test_done will delete the trash directory containing
-# our socket, leaving us with no way to access the daemon.
-git credential-cache exit
-
test_done