From 78b2bc4f600fa8f18c8d513d2a835f09a840882c Mon Sep 17 00:00:00 2001 From: mjarkk Date: Wed, 31 Oct 2018 16:23:58 +0100 Subject: [PATCH] Made a better way of test pushing --- pkg/commands/git_test.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/commands/git_test.go b/pkg/commands/git_test.go index bef067624..dba1874c3 100644 --- a/pkg/commands/git_test.go +++ b/pkg/commands/git_test.go @@ -1022,7 +1022,12 @@ func TestGitCommandPush(t *testing.T) { return "-" }) errMessage := err.Error() - if strings.Contains(errMessage, "error: src refspec test does not match any.") { + cutrange := 43 + if len(errMessage) < 43 { + cutrange = len(errMessage) + } + testMessage := errMessage[:cutrange] + if strings.Contains("error: src refspec test does not match any.", testMessage) { err = nil } s.test(err)