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.
32
32
. ./test-lib.sh
33
33
. " $TEST_DIRECTORY " /lib-credential.sh
34
34
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.
35
45
if 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
38
53
fi
39
54
40
55
test -z " $GIT_TEST_CREDENTIAL_HELPER_SETUP " ||
59
74
# might be long-term system storage
60
75
helper_test_clean " $GIT_TEST_CREDENTIAL_HELPER "
61
76
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
+
62
84
test_done
You can’t perform that action at this time.
0 commit comments