From d62e21025c0680b05ff185750c2eafe7d81a3648 Mon Sep 17 00:00:00 2001 From: Nicolas De Loof Date: Wed, 23 Jul 2025 11:57:09 +0200 Subject: [PATCH] forward git command error to user Signed-off-by: Nicolas De Loof --- pkg/remote/git.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/remote/git.go b/pkg/remote/git.go index ca170daf5..a7d27afba 100644 --- a/pkg/remote/git.go +++ b/pkg/remote/git.go @@ -133,12 +133,12 @@ func (g gitRemoteLoader) resolveGitRef(ctx context.Context, path string, ref *gi if !commitSHA.MatchString(ref.Commit) { cmd := exec.CommandContext(ctx, "git", "ls-remote", "--exit-code", ref.Remote, ref.Commit) cmd.Env = g.gitCommandEnv() - out, err := cmd.Output() + out, err := cmd.CombinedOutput() if err != nil { if cmd.ProcessState.ExitCode() == 2 { return fmt.Errorf("repository does not contain ref %s, output: %q: %w", path, string(out), err) } - return err + return fmt.Errorf("failed to access repository at %s:\n %s", ref.Remote, out) } if len(out) < 40 { return fmt.Errorf("unexpected git command output: %q", string(out))