Skip to content

Commit

Permalink
Simplify load_git_details.go; remove unnecessary Abs() call
Browse files Browse the repository at this point in the history
  • Loading branch information
denik committed Dec 2, 2024
1 parent f9d65f3 commit d1dd099
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions bundle/config/mutator/load_git_details.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit d1dd099

Please sign in to comment.