2015-07-30 02:37:31 +00:00
|
|
|
#!/usr/bin/env bash
|
2015-05-19 01:09:32 +00:00
|
|
|
# Including in script/integration and every test/test-*.sh file.
|
2015-05-18 23:28:58 +00:00
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2015-06-19 17:06:55 +00:00
|
|
|
# The root directory for the git-lfs repository by default.
|
|
|
|
if [ -z "$ROOTDIR" ]; then
|
|
|
|
ROOTDIR=$(cd $(dirname "$0")/.. && pwd)
|
|
|
|
fi
|
2015-05-19 22:54:15 +00:00
|
|
|
|
|
|
|
# Where Git LFS outputs the compiled binaries
|
2015-05-18 23:28:58 +00:00
|
|
|
BINPATH="$ROOTDIR/bin"
|
2015-05-19 22:54:15 +00:00
|
|
|
|
|
|
|
# Put bin path on PATH
|
2015-05-18 23:28:58 +00:00
|
|
|
PATH="$BINPATH:$PATH"
|
|
|
|
|
|
|
|
# create a temporary work space
|
2015-06-19 17:06:55 +00:00
|
|
|
TMPDIR=${GIT_LFS_TEST_DIR:-"$ROOTDIR/tmp"}
|
2015-05-19 22:54:15 +00:00
|
|
|
|
|
|
|
# This is unique to every test file, and cleared after every test run.
|
2015-05-18 23:28:58 +00:00
|
|
|
TRASHDIR="$TMPDIR/$(basename "$0")-$$"
|
|
|
|
|
2015-05-19 22:54:15 +00:00
|
|
|
# The directory that the test Git server works from. This cleared at the
|
|
|
|
# beginning of every test run.
|
2015-05-18 23:28:58 +00:00
|
|
|
REMOTEDIR="$ROOTDIR/test/remote"
|
2015-05-19 22:54:15 +00:00
|
|
|
|
2015-08-04 16:06:30 +00:00
|
|
|
# The directory that stores credentials. Credentials are stored in files with
|
|
|
|
# the username:password with filenames identifying the host (port numbers are
|
|
|
|
# ignored).
|
|
|
|
#
|
|
|
|
# # stores the credentials for http://127.0.0.1:*
|
|
|
|
# $CREDSDIR/127.0.0.1
|
|
|
|
#
|
|
|
|
# # stores the credentials for http://git-server.com
|
|
|
|
# $CREDSDIR/git-server.com
|
|
|
|
#
|
|
|
|
CREDSDIR="$REMOTEDIR/creds"
|
|
|
|
|
2015-05-19 22:54:15 +00:00
|
|
|
# This is the prefix for Git config files. See the "Test Suite" section in
|
|
|
|
# test/README.md
|
2015-05-18 23:28:58 +00:00
|
|
|
LFS_CONFIG="$REMOTEDIR/config"
|
|
|
|
|
2015-05-19 22:54:15 +00:00
|
|
|
# This file contains the URL of the test Git server. See the "Test Suite"
|
|
|
|
# section in test/README.md
|
|
|
|
LFS_URL_FILE="$REMOTEDIR/url"
|
|
|
|
|
2015-07-30 02:03:57 +00:00
|
|
|
# the fake home dir used for the initial setup
|
|
|
|
TESTHOME="$REMOTEDIR/home"
|
|
|
|
|
2015-05-26 15:47:57 +00:00
|
|
|
GIT_CONFIG_NOSYSTEM=1
|
2015-05-26 15:39:04 +00:00
|
|
|
|
2015-07-30 02:03:57 +00:00
|
|
|
if [[ `git config --system credential.helper | grep osxkeychain` == "osxkeychain" ]]
|
|
|
|
then
|
|
|
|
OSXKEYFILE="$TMPDIR/temp.keychain"
|
|
|
|
fi
|
|
|
|
|
|
|
|
mkdir -p "$TMPDIR"
|
2015-05-18 23:28:58 +00:00
|
|
|
mkdir -p "$TRASHDIR"
|
|
|
|
|
|
|
|
. "test/testhelpers.sh"
|