mirror of https://github.com/databricks/cli.git
Remove unused function git.RepoExists (#183)
This function is no longer in use. The SDK has native functionality for this through `GetByName`. Closes #57.
This commit is contained in:
parent
35c3d9fa4e
commit
df7b341afe
18
git/git.go
18
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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue