Skip to content

Commit

Permalink
switch to folders.FindDirWithLeaf
Browse files Browse the repository at this point in the history
  • Loading branch information
denik committed Dec 10, 2024
1 parent 8b5bb37 commit dab674b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 41 deletions.
4 changes: 2 additions & 2 deletions internal/bundle/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"github.com/databricks/cli/libs/env"
"github.com/databricks/cli/libs/filer"
"github.com/databricks/cli/libs/flags"
"github.com/databricks/cli/libs/git"
"github.com/databricks/cli/libs/folders"
"github.com/databricks/cli/libs/template"
"github.com/databricks/databricks-sdk-go"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -144,7 +144,7 @@ func getBundleRemoteRootPath(w *databricks.WorkspaceClient, t *testing.T, unique
}

func blackBoxRun(t *testing.T, root string, args ...string) (stdout string, stderr string) {
gitRoot, err := git.FindLeafInTree(".", ".git")
gitRoot, err := folders.FindDirWithLeaf(".", ".git")
require.NoError(t, err)

t.Setenv("BUNDLE_ROOT", root)
Expand Down
3 changes: 2 additions & 1 deletion libs/git/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"strings"

"github.com/databricks/cli/libs/dbr"
"github.com/databricks/cli/libs/folders"
"github.com/databricks/cli/libs/log"
"github.com/databricks/cli/libs/vfs"
"github.com/databricks/databricks-sdk-go"
Expand Down Expand Up @@ -105,7 +106,7 @@ func ensureWorkspacePrefix(p string) string {
func fetchRepositoryInfoDotGit(ctx context.Context, path string) (RepositoryInfo, error) {
result := RepositoryInfo{}

rootDir, err := FindLeafInTree(path, GitDirectoryName)
rootDir, err := folders.FindDirWithLeaf(path, GitDirectoryName)
if rootDir == "" {
return result, err
}
Expand Down
38 changes: 0 additions & 38 deletions libs/git/info_test.go

This file was deleted.

0 comments on commit dab674b

Please sign in to comment.