From 153d170bbbbfcb8d3729e34789a31fe5be020b6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Mur=C3=A9?= Date: Sun, 22 Nov 2020 21:24:42 +0100 Subject: [PATCH] attempt to fix tests on windows --- repository/git.go | 3 ++- repository/gogit.go | 2 +- repository/mock_repo.go | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/repository/git.go b/repository/git.go index 504cdd8903a0e2cca639fb30a657e70453a0b6d2..36bb6f040d1858907d0acccd2c294b5a232862b0 100644 --- a/repository/git.go +++ b/repository/git.go @@ -5,6 +5,7 @@ import ( "bytes" "fmt" "path" + "path/filepath" "strings" "sync" @@ -131,7 +132,7 @@ func (repo *GitRepo) Keyring() Keyring { // GetPath returns the path to the repo. func (repo *GitRepo) GetPath() string { - return repo.path + return filepath.FromSlash(repo.path) } // GetUserName returns the name the the user has used to configure git diff --git a/repository/gogit.go b/repository/gogit.go index c59409d493214d7a6e6379edbe48769cef03dd99..d9421e64b7c53e1f91cd50b3227d173a5d5fd507 100644 --- a/repository/gogit.go +++ b/repository/gogit.go @@ -197,7 +197,7 @@ func (repo *GoGitRepo) Keyring() Keyring { // GetPath returns the path to the repo. func (repo *GoGitRepo) GetPath() string { - return repo.path + return filepath.FromSlash(repo.path) } // GetUserName returns the name the the user has used to configure git diff --git a/repository/mock_repo.go b/repository/mock_repo.go index 628939aab9975997999c47843815cff0839135c0..bd8dd00f2c6e2b79fce0373f3b02d7939977586a 100644 --- a/repository/mock_repo.go +++ b/repository/mock_repo.go @@ -3,6 +3,7 @@ package repository import ( "crypto/sha1" "fmt" + "path/filepath" "strings" "github.com/99designs/keyring" @@ -88,7 +89,7 @@ func NewMockRepoCommon() *mockRepoCommon { // GetPath returns the path to the repo. func (r *mockRepoCommon) GetPath() string { - return "~/mockRepo/" + return filepath.FromSlash("~/mockRepo/") } func (r *mockRepoCommon) GetUserName() (string, error) {