From 63f388f4e0054b0209a2bc2e7fcc60b6316f3e41 Mon Sep 17 00:00:00 2001 From: risk danger olson Date: Tue, 11 Aug 2015 14:18:30 -0600 Subject: [PATCH] don't use ldflags in credential tests gccgo silently ignores them, causing tests to fail. --- test/cmd/git-credential-lfstest.go | 8 +++++++- test/testenv.sh | 2 ++ test/testhelpers.sh | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/test/cmd/git-credential-lfstest.go b/test/cmd/git-credential-lfstest.go index b2f24036..4bcddd03 100644 --- a/test/cmd/git-credential-lfstest.go +++ b/test/cmd/git-credential-lfstest.go @@ -21,9 +21,15 @@ var ( hostRE = regexp.MustCompile(`\A127.0.0.1:\d+\z`) - credsDir = "wat" + credsDir = "" ) +func init() { + if len(credsDir) == 0 { + credsDir = os.Getenv("CREDSDIR") + } +} + func main() { if argsize := len(os.Args); argsize != 2 { fmt.Fprintf(os.Stderr, "wrong number of args: %d\n", argsize) diff --git a/test/testenv.sh b/test/testenv.sh index 9a532fb9..a3f7e98a 100644 --- a/test/testenv.sh +++ b/test/testenv.sh @@ -49,6 +49,8 @@ TESTHOME="$REMOTEDIR/home" GIT_CONFIG_NOSYSTEM=1 +export CREDSDIR + if [[ `git config --system credential.helper | grep osxkeychain` == "osxkeychain" ]] then OSXKEYFILE="$TMPDIR/temp.keychain" diff --git a/test/testhelpers.sh b/test/testhelpers.sh index 3395b819..c94df8a7 100644 --- a/test/testhelpers.sh +++ b/test/testhelpers.sh @@ -165,7 +165,7 @@ setup() { if [ -z "$SKIPCOMPILE" ]; then for go in test/cmd/*.go; do - go build -ldflags "-X main.credsDir $CREDSDIR" -o "$BINPATH/$(basename $go .go)" "$go" + go build -o "$BINPATH/$(basename $go .go)" "$go" done fi