From 0e088eb9f8c034aea93184ad25f752bb5ac0e58d Mon Sep 17 00:00:00 2001 From: Denis Bilenko Date: Mon, 2 Dec 2024 23:41:38 +0100 Subject: [PATCH] Simplify load_git_details.go; remove unnecessary Abs() call (#1950) Suggested here https://github.com/databricks/cli/pull/1945#discussion_r1866088579 --- bundle/config/mutator/load_git_details.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/bundle/config/mutator/load_git_details.go b/bundle/config/mutator/load_git_details.go index 00e7f54d..77558d9b 100644 --- a/bundle/config/mutator/load_git_details.go +++ b/bundle/config/mutator/load_git_details.go @@ -55,13 +55,8 @@ func (m *loadGitDetails) Apply(ctx context.Context, b *bundle.Bundle) diag.Diagn 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 - relBundlePath, err := filepath.Rel(repo.Root(), absBundlePath) + relBundlePath, err := filepath.Rel(repo.Root(), b.BundleRoot.Native()) if err != nil { return diag.FromErr(err) }