From d0a6e7ceecd3abc0d4036f2d0769a8a6a2317fb4 Mon Sep 17 00:00:00 2001 From: Hidde Beydals Date: Wed, 13 Mar 2019 15:59:19 +0100 Subject: [PATCH] Cleanup obsolete gittest repo changes --- daemon/daemon_test.go | 2 +- git/gittest/repo.go | 11 +++-------- git/gittest/repo_test.go | 2 +- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/daemon/daemon_test.go b/daemon/daemon_test.go index 11b77a2f4..03b662434 100644 --- a/daemon/daemon_test.go +++ b/daemon/daemon_test.go @@ -671,7 +671,7 @@ func mockDaemon(t *testing.T) (*Daemon, func(), func(), *cluster.Mock, *mockEven }, } - repo, repoCleanup := gittest.Repo(t, "") + repo, repoCleanup := gittest.Repo(t) params := git.Config{ Branch: "master", UserName: "example", diff --git a/git/gittest/repo.go b/git/gittest/repo.go index 3994fc4f8..a03b85781 100644 --- a/git/gittest/repo.go +++ b/git/gittest/repo.go @@ -2,7 +2,6 @@ package gittest import ( "context" - "fmt" "io/ioutil" "os/exec" "path/filepath" @@ -15,7 +14,7 @@ import ( // Repo creates a new clone-able git repo, pre-populated with some kubernetes // files and a few commits. Also returns a cleanup func to clean up after. -func Repo(t *testing.T, signingKey string) (*git.Repo, func()) { +func Repo(t *testing.T) (*git.Repo, func()) { newDir, cleanup := testfiles.TempDir(t) filesDir := filepath.Join(newDir, "files") @@ -45,11 +44,7 @@ func Repo(t *testing.T, signingKey string) (*git.Repo, func()) { cleanup() t.Fatal(err) } - args := []string{"-C", filesDir, "commit", "-m", "'Initial revision'"} - if signingKey != "" { - args = append(args, fmt.Sprintf("--gpg-sign=%s", signingKey)) - } - if err = execCommand("git", args...); err != nil { + if err = execCommand("git", "-C", filesDir, "commit", "-m", "'Initial revision'"); err != nil { cleanup() t.Fatal(err) } @@ -80,7 +75,7 @@ func Workloads() (res []flux.ResourceID) { // CheckoutWithConfig makes a standard repo, clones it, and returns // the clone, the original repo, and a cleanup function. func CheckoutWithConfig(t *testing.T, config git.Config) (*git.Checkout, *git.Repo, func()) { - repo, cleanup := Repo(t, config.SigningKey) + repo, cleanup := Repo(t) if err := repo.Ready(context.Background()); err != nil { cleanup() t.Fatal(err) diff --git a/git/gittest/repo_test.go b/git/gittest/repo_test.go index e3fdc75ad..ca92ec08a 100644 --- a/git/gittest/repo_test.go +++ b/git/gittest/repo_test.go @@ -151,7 +151,7 @@ func TestSignedTag(t *testing.T) { } func TestCheckout(t *testing.T) { - repo, cleanup := Repo(t, "") + repo, cleanup := Repo(t) defer cleanup() sd, sg := make(chan struct{}), &sync.WaitGroup{}