mirror of https://github.com/databricks/cli.git
rename fixResponsePath to ensureWorkspacePrefix
This commit is contained in:
parent
d4237ae582
commit
18c639c78b
|
@ -70,7 +70,7 @@ func fetchRepositoryInfoAPI(ctx context.Context, path vfs.Path, w *databricks.Wo
|
||||||
if gi == nil {
|
if gi == nil {
|
||||||
log.Warnf(ctx, "Failed to load git info from %s", apiEndpoint)
|
log.Warnf(ctx, "Failed to load git info from %s", apiEndpoint)
|
||||||
} else {
|
} else {
|
||||||
fixedPath := fixResponsePath(gi.Path)
|
fixedPath := ensureWorkspacePrefix(gi.Path)
|
||||||
return GitRepositoryInfo{
|
return GitRepositoryInfo{
|
||||||
OriginURL: gi.URL,
|
OriginURL: gi.URL,
|
||||||
LatestCommit: gi.HeadCommitID,
|
LatestCommit: gi.HeadCommitID,
|
||||||
|
@ -84,7 +84,7 @@ func fetchRepositoryInfoAPI(ctx context.Context, path vfs.Path, w *databricks.Wo
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func fixResponsePath(path string) string {
|
func ensureWorkspacePrefix(path string) string {
|
||||||
if !strings.HasPrefix(path, "/Workspace/") {
|
if !strings.HasPrefix(path, "/Workspace/") {
|
||||||
return "/Workspace/" + path
|
return "/Workspace/" + path
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue