Skip to content

Commit

Permalink
backport of commit 7914464
Browse files Browse the repository at this point in the history
  • Loading branch information
lbajolet-hashicorp committed Sep 13, 2024
1 parent 97fc630 commit 2dee325
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions internal/hcp/registry/metadata/vcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,14 @@ func (g *Git) Type() string {
}

func (g *Git) Details() map[string]interface{} {
resp := map[string]interface{}{}

headRef, err := g.repo.Head()
if err != nil {
log.Printf("[ERROR] failed to get the git branch name: %s", err)
} else {
resp["ref"] = headRef.Name().Short()
log.Printf("[ERROR] failed to get reference to git HEAD: %s", err)
return nil
}

resp := map[string]interface{}{
"ref": headRef.Name().Short(),
}

commit, err := g.repo.CommitObject(headRef.Hash())
Expand Down

0 comments on commit 2dee325

Please sign in to comment.