diff --git a/t/cmd/git-credential-lfstest.go b/t/cmd/git-credential-lfstest.go index b0379e76..f3f131ef 100644 --- a/t/cmd/git-credential-lfstest.go +++ b/t/cmd/git-credential-lfstest.go @@ -89,7 +89,17 @@ func fill() { } func credsForHostAndPath(host, path string) (string, string, error) { - hostFilename := filepath.Join(credsDir, host) + var hostFilename string + + // We need hostFilename to end in a slash so that our credentials all + // end up in the same directory. credsDir will come in from the + // testsuite with a slash, but filepath.Join will strip it off if host + // is empty, such as when we have a file:/// or cert:/// URL. + if host != "" { + hostFilename = filepath.Join(credsDir, host) + } else { + hostFilename = credsDir + } if len(path) > 0 { pathFilename := fmt.Sprintf("%s--%s", hostFilename, strings.Replace(path, "/", "-", -1)) diff --git a/t/testenv.sh b/t/testenv.sh index 65c4325a..1fb7ff99 100644 --- a/t/testenv.sh +++ b/t/testenv.sh @@ -90,7 +90,7 @@ REMOTEDIR="$ROOTDIR/t/remote" # # stores the credentials for http://git-server.com # $CREDSDIR/git-server.com # -CREDSDIR="$REMOTEDIR/creds" +CREDSDIR="$REMOTEDIR/creds/" # This is the prefix for Git config files. See the "Test Suite" section in # t/README.md