Address code review feedback: use strings.Contains and remove extra blank line

Co-authored-by: Songmu <177122+Songmu@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-02-13 17:37:19 +00:00
parent 9515744ee5
commit 640fb3f223
2 changed files with 2 additions and 15 deletions

View file

@ -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
}

1
vcs.go
View file

@ -94,7 +94,6 @@ func getGitRemoteURL(dir string) (string, error) {
return finalURL, nil
}
// GitBackend is the VCSBackend of git
var GitBackend = &VCSBackend{
// support submodules?