git-lfs/test/test-credentials-no-prompt.sh
Sebastian Schuberth d54a2949be Remove system credential helper specific work-arounds in tests
Now that we really do not read the system config anymore we can remove
these.
2016-09-28 21:30:05 +02:00

31 lines
768 B
Bash
Executable File

#!/usr/bin/env bash
. "test/testlib.sh"
# these tests rely on GIT_TERMINAL_PROMPT to test properly
ensure_git_version_isnt $VERSION_LOWER "2.3.0"
begin_test "attempt private access without credential helper"
(
set -e
reponame="$(basename "$0" ".sh")"
setup_remote_repo "$reponame"
clone_repo "$reponame" without-creds
git lfs track "*.dat"
echo "hi" > hi.dat
git add hi.dat
git add .gitattributes
git commit -m "initial commit"
git config --global credential.helper lfsnoop
git config credential.helper lfsnoop
git config -l
GIT_TERMINAL_PROMPT=0 git push origin master 2>&1 | tee push.log
grep "Authorization error: $GITSERVER/$reponame" push.log ||
grep "Git credentials for $GITSERVER/$reponame not found" push.log
)
end_test