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:
Pieter Noordhuis 2023-01-26 21:11:15 +01:00 committed by GitHub
parent 35c3d9fa4e
commit df7b341afe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 18 deletions

View File

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