mirror of https://github.com/databricks/cli.git
Always use commit and originUrl from the git repository
Previously users were able to override commit and originUrl in the config, this was never intended.
This commit is contained in:
parent
6fc2093a22
commit
7243eda92e
|
@ -40,20 +40,12 @@ func (m *loadGitDetails) Apply(ctx context.Context, b *bundle.Bundle) diag.Diagn
|
|||
log.Warnf(ctx, "failed to load current branch: %s", err)
|
||||
}
|
||||
|
||||
// load commit hash if undefined
|
||||
if b.Config.Bundle.Git.Commit == "" {
|
||||
commit, err := repo.LatestCommit()
|
||||
if err != nil {
|
||||
log.Warnf(ctx, "failed to load latest commit: %s", err)
|
||||
} else {
|
||||
b.Config.Bundle.Git.Commit = commit
|
||||
}
|
||||
}
|
||||
// load origin url if undefined
|
||||
if b.Config.Bundle.Git.OriginURL == "" {
|
||||
remoteUrl := repo.OriginUrl()
|
||||
b.Config.Bundle.Git.OriginURL = remoteUrl
|
||||
commit, err := repo.LatestCommit()
|
||||
if err != nil {
|
||||
log.Warnf(ctx, "failed to load latest commit: %s", err)
|
||||
}
|
||||
b.Config.Bundle.Git.Commit = commit
|
||||
b.Config.Bundle.Git.OriginURL = repo.OriginUrl()
|
||||
|
||||
// Compute relative path of the bundle root from the Git repo root.
|
||||
absBundlePath, err := filepath.Abs(b.BundleRootPath)
|
||||
|
|
Loading…
Reference in New Issue