From 13874ce5527892197bb1786971bc258ca7bd5a9a Mon Sep 17 00:00:00 2001 From: Stefan Prodan Date: Fri, 16 Oct 2020 15:58:09 +0300 Subject: [PATCH] Add Git URL to clone error message Signed-off-by: Stefan Prodan --- pkg/git/checkout.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/git/checkout.go b/pkg/git/checkout.go index 1f504978..0b7fef05 100644 --- a/pkg/git/checkout.go +++ b/pkg/git/checkout.go @@ -77,7 +77,7 @@ func (c *CheckoutBranch) Checkout(ctx context.Context, path, url string, auth tr Tags: git.NoTags, }) if err != nil { - return nil, "", fmt.Errorf("git clone error: %w", err) + return nil, "", fmt.Errorf("unable to clone '%s', error: %w", url, err) } head, err := repo.Head() if err != nil { @@ -108,7 +108,7 @@ func (c *CheckoutTag) Checkout(ctx context.Context, path, url string, auth trans Tags: git.NoTags, }) if err != nil { - return nil, "", fmt.Errorf("git clone error: %w", err) + return nil, "", fmt.Errorf("unable to clone '%s', error: %w", url, err) } head, err := repo.Head() if err != nil { @@ -139,7 +139,7 @@ func (c *CheckoutCommit) Checkout(ctx context.Context, path, url string, auth tr Tags: git.NoTags, }) if err != nil { - return nil, "", fmt.Errorf("git clone error: %w", err) + return nil, "", fmt.Errorf("unable to clone '%s', error: %w", url, err) } w, err := repo.Worktree() if err != nil { @@ -180,7 +180,7 @@ func (c *CheckoutSemVer) Checkout(ctx context.Context, path, url string, auth tr Tags: git.AllTags, }) if err != nil { - return nil, "", fmt.Errorf("git clone error: %w", err) + return nil, "", fmt.Errorf("unable to clone '%s', error: %w", url, err) } repoTags, err := repo.Tags()