diff --git a/cmd_migrate_test.go b/cmd_migrate_test.go index 0bd38d6..36677a7 100644 --- a/cmd_migrate_test.go +++ b/cmd_migrate_test.go @@ -4,6 +4,7 @@ import ( "os" "os/exec" "path/filepath" + "strings" "sync" "testing" ) @@ -152,21 +153,8 @@ func TestMigrateEdgeCases(t *testing.T) { t.Error("should fail for unsupported VCS (CVS)") } // Check that the error message mentions unsupported VCS - if e != nil && !contains(e.Error(), "not supported") { + if e != nil && !strings.Contains(e.Error(), "not supported") { t.Errorf("expected 'not supported' error, got: %v", e) } }) } - -func contains(s, substr string) bool { - return len(s) >= len(substr) && (s == substr || len(s) > len(substr) && containsHelper(s, substr)) -} - -func containsHelper(s, substr string) bool { - for i := 0; i <= len(s)-len(substr); i++ { - if s[i:i+len(substr)] == substr { - return true - } - } - return false -} diff --git a/vcs.go b/vcs.go index 79acbf8..8e28ee3 100644 --- a/vcs.go +++ b/vcs.go @@ -94,7 +94,6 @@ func getGitRemoteURL(dir string) (string, error) { return finalURL, nil } - // GitBackend is the VCSBackend of git var GitBackend = &VCSBackend{ // support submodules?