3 . "$(dirname "$0")/testlib.sh"
5 # these tests rely on GIT_TERMINAL_PROMPT to test properly
6 ensure_git_version_isnt $VERSION_LOWER "2.3.0"
8 begin_test "attempt private access without credential helper"
12 reponame="$(basename "$0" ".sh")"
13 setup_remote_repo "$reponame"
14 clone_repo "$reponame" without-creds
19 git add .gitattributes
20 git commit -m "initial commit"
22 git config --global credential.helper lfsnoop
23 git config credential.helper lfsnoop
26 GIT_TERMINAL_PROMPT=0 git push origin master 2>&1 | tee push.log
27 grep "Authorization error: $GITSERVER/$reponame" push.log ||
28 grep "Git credentials for $GITSERVER/$reponame not found" push.log
32 begin_test "askpass: push with bad askpass"
36 reponame="askpass-with-bad-askpass"
37 setup_remote_repo "$reponame"
38 clone_repo "$reponame" "$reponame"
43 git add .gitattributes a.dat
44 git commit -m "initial commit"
46 git config "credential.helper" ""
47 GIT_TERMINAL_PROMPT=0 GIT_ASKPASS="lfs-askpass-2" SSH_ASKPASS="dont-call-me" GIT_TRACE=1 git push origin master 2>&1 | tee push.log
48 grep "filling with GIT_ASKPASS" push.log # attempt askpass
49 grep 'credential fill error: exec: "lfs-askpass-2"' push.log # askpass fails
50 grep "creds: git credential fill" push.log # attempt git credential