File tree Expand file tree Collapse file tree 1 file changed +24
-2
lines changed Expand file tree Collapse file tree 1 file changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -32,9 +32,24 @@ commands.
3232. ./test-lib.sh
3333. " $TEST_DIRECTORY " /lib-credential.sh
3434
35+ # If we're not given a specific external helper to run against,
36+ # there isn't much to test. But we can still run through our
37+ # battery of tests with a fake helper and check that the
38+ # test themselves are self-consistent and clean up after
39+ # themselves.
40+ #
41+ # We'll use the "store" helper, since we can easily inspect
42+ # its state by looking at the on-disk file. But since it doesn't
43+ # implement any caching or expiry logic, we'll cheat and override
44+ # the "check" function to just report all results as OK.
3545if test -z " $GIT_TEST_CREDENTIAL_HELPER " ; then
36- skip_all=" used to test external credential helpers"
37- test_done
46+ GIT_TEST_CREDENTIAL_HELPER=store
47+ GIT_TEST_CREDENTIAL_HELPER_TIMEOUT=store
48+ check () {
49+ test " $1 " = " approve" || return 0
50+ git -c credential.helper=store credential approve
51+ }
52+ check_cleanup=t
3853fi
3954
4055test -z " $GIT_TEST_CREDENTIAL_HELPER_SETUP " ||
5974# might be long-term system storage
6075helper_test_clean " $GIT_TEST_CREDENTIAL_HELPER "
6176
77+ if test " $check_cleanup " = " t"
78+ then
79+ test_expect_success ' test cleanup removes everything' '
80+ test_must_be_empty "$HOME/.git-credentials"
81+ '
82+ fi
83+
6284test_done
You can’t perform that action at this time.
0 commit comments