mirror of https://github.com/databricks/cli.git
Simplify load_git_details.go; remove unnecessary Abs() call (#1950)
Suggested here https://github.com/databricks/cli/pull/1945#discussion_r1866088579
This commit is contained in:
parent
2847533e1e
commit
0e088eb9f8
|
@ -55,13 +55,8 @@ func (m *loadGitDetails) Apply(ctx context.Context, b *bundle.Bundle) diag.Diagn
|
||||||
b.Config.Bundle.Git.OriginURL = remoteUrl
|
b.Config.Bundle.Git.OriginURL = remoteUrl
|
||||||
}
|
}
|
||||||
|
|
||||||
// Compute relative path of the bundle root from the Git repo root.
|
|
||||||
absBundlePath, err := filepath.Abs(b.BundleRootPath)
|
|
||||||
if err != nil {
|
|
||||||
return diag.FromErr(err)
|
|
||||||
}
|
|
||||||
// repo.Root() returns the absolute path of the repo
|
// repo.Root() returns the absolute path of the repo
|
||||||
relBundlePath, err := filepath.Rel(repo.Root(), absBundlePath)
|
relBundlePath, err := filepath.Rel(repo.Root(), b.BundleRoot.Native())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return diag.FromErr(err)
|
return diag.FromErr(err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue