From f2a6981a112d9343f091073c9851fad775e778c6 Mon Sep 17 00:00:00 2001 From: Florian Hines Date: Thu, 10 Oct 2024 20:29:38 -0500 Subject: [PATCH] bubble up more detailed git errors (#427) * bubble up more detailed git errors * pr feedback --- cli/cmd/release_create.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cli/cmd/release_create.go b/cli/cmd/release_create.go index 73e5fbea..7976b2cb 100644 --- a/cli/cmd/release_create.go +++ b/cli/cmd/release_create.go @@ -71,24 +71,24 @@ func (r *runners) gitSHABranch() (sha string, branch string, dirty bool, err err rev := "HEAD" repository, err := git.PlainOpenWithOptions(path, &git.PlainOpenOptions{DetectDotGit: true}) if err != nil { - return "", "", false, errors.Wrapf(err, "open %q", path) + return "", "", false, fmt.Errorf("git open '%q' failed: %w", path, err) } h, err := repository.ResolveRevision(plumbing.Revision(rev)) if err != nil { - return "", "", false, errors.Wrapf(err, "resolve revision") + return "", "", false, fmt.Errorf("git resolve revision '%q' failed: %w", rev, err) } head, err := repository.Head() if err != nil { - return "", "", false, errors.Wrapf(err, "resolve HEAD") + return "", "", false, fmt.Errorf("git resolve HEAD failed: %w", err) } worktree, err := repository.Worktree() if err != nil { - return "", "", false, errors.Wrap(err, "get git worktree") + return "", "", false, fmt.Errorf("git get worktree failed: %w", err) } status, err := worktree.Status() if err != nil { - return "", "", false, errors.Wrap(err, "get git status") + return "", "", false, fmt.Errorf("git get status failed: %w", err) } branchName := head.Name().Short()