You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix spurious git-info warning on DBR acceptance tests (#5426)
## Problem
Acceptance tests on DBR were failing because we would emit a warning
that the repo does not exist. That did not happen normally (the warnings
were silenced) causing test failures. This PR fixes that.
Copy file name to clipboardExpand all lines: libs/git/info.go
+25-3Lines changed: 25 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,8 @@ package git
2
2
3
3
import (
4
4
"context"
5
+
"errors"
6
+
"io/fs"
5
7
"net/http"
6
8
"path"
7
9
"strings"
@@ -12,6 +14,7 @@ import (
12
14
"github.com/databricks/cli/libs/log"
13
15
"github.com/databricks/cli/libs/vfs"
14
16
"github.com/databricks/databricks-sdk-go"
17
+
"github.com/databricks/databricks-sdk-go/apierr"
15
18
"github.com/databricks/databricks-sdk-go/client"
16
19
)
17
20
@@ -37,18 +40,29 @@ type response struct {
37
40
}
38
41
39
42
// Fetch repository information either by quering .git or by fetching it from API (for dabs-in-workspace case).
40
-
// - In case we could not find git repository, all string fields of RepositoryInfo will be "" and err will be nil.
43
+
// - In case we could not find git repository (including when the path does not exist), all string fields of RepositoryInfo will be "" and err will be nil.
41
44
// - If there were any errors when trying to determine git root (e.g. API call returned an error or there were permission issues
42
45
// reading the file system), all strings fields of RepositoryInfo will be "" and err will be non-nil.
43
46
// - If we could determine git worktree root but there were errors when reading metadata (origin, branch, commit), those errors
44
47
// will be logged as warnings, RepositoryInfo is guaranteed to have non-empty WorktreeRoot and other fields on best effort basis.
45
48
// - In successful case, all fields are set to proper git repository metadata.
0 commit comments