git-lfs/t/t-push-bad-dns.sh
brian m. carlson 9e006ac4e2
Rename default branch in tests to "main"
Currently, our default branch in tests is "master".  This is the Git
default, but the Git default will likely change in the future, so it
makes sense to update our testsuite to be explicit about the branch
name.  We'll ensure this continues by building against older versions of
Git as well as newer versions.

We use "main" for the new branch name, since that's the proposed value
upstream.

This commit was made entirely by automated means using the following
command:

  git grep -l master t | xargs sed -i -e 's/master/main/g'
2020-07-08 15:38:17 +00:00

37 lines
748 B
Bash
Executable File

#!/usr/bin/env bash
. "$(dirname "$0")/testlib.sh"
ensure_git_version_isnt $VERSION_LOWER "2.3.0"
begin_test "push: upload to bad dns"
(
set -e
reponame="$(basename "$0" ".sh")-bad-dns"
setup_remote_repo "$reponame"
clone_repo "$reponame" "$reponame"
git lfs track "*.dat"
printf "hi" > good.dat
git add .gitattributes good.dat
git commit -m "welp"
port="$(echo "http://127.0.0.1:63378" | cut -f 3 -d ":")"
git config lfs.url "http://git-lfs-bad-dns:$port"
set +e
GIT_TERMINAL_PROMPT=0 git push origin main 2>&1 | tee push.log
res="${PIPESTATUS[0]}"
set -e
refute_server_object "$reponame" "$(calc_oid "hi")"
if [ "$res" = "0" ]; then
cat push.log
echo "push successful?"
exit 1
fi
)
end_test