From df7b341afe60d26ad5d96e845e6b19105d8aaad3 Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Thu, 26 Jan 2023 21:11:15 +0100 Subject: [PATCH] Remove unused function git.RepoExists (#183) This function is no longer in use. The SDK has native functionality for this through `GetByName`. Closes #57. --- git/git.go | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/git/git.go b/git/git.go index 33d322fa..75d5d2c7 100644 --- a/git/git.go +++ b/git/git.go @@ -1,7 +1,6 @@ package git import ( - "context" "fmt" "net/url" "os" @@ -9,8 +8,6 @@ import ( "strings" "github.com/databricks/bricks/folders" - "github.com/databricks/databricks-sdk-go" - "github.com/databricks/databricks-sdk-go/service/repos" giturls "github.com/whilp/git-urls" "gopkg.in/ini.v1" ) @@ -81,18 +78,3 @@ func RepositoryName() (string, error) { base := path.Base(origin.Path) return strings.TrimSuffix(base, ".git"), nil } - -func RepoExists(remotePath string, ctx context.Context, w *databricks.WorkspaceClient) (bool, error) { - repos, err := w.Repos.ListAll(ctx, repos.List{}) - if err != nil { - return false, fmt.Errorf("could not get repos: %s", err) - } - foundRepo := false - for _, repo := range repos { - if repo.Path == remotePath { - foundRepo = true - break - } - } - return foundRepo, nil -}