Skip to content

Capture stderr in Git clone error #101

@rgmz

Description

@rgmz

Is your feature request related to a problem? Please describe.
When a clone fails, a vague error is printed to the console with the exit code. Unfortunately, 128 is a catch-all exit code for fatal events, so it isn't possible to determine the issue based on this alone.

For example, the following repository fails with exit status 128. However, in order to determine the actual cause we need to clone the repository ourselves:

# Poutine output
9:37PM | ERROR | failed to clone repo error="failed to clone repo: exit status 128" repo=ecomfe/stylecs

#  Git output
$ git clone https://github.com/ecomfe/es6-code-style
Cloning into 'es6-code-style'...
warning: You appear to have cloned an empty repository.

Describe the solution you'd like
Capture stderr in in the GitClient clone method.

func (g *GitClient) Clone(ctx context.Context, clonePath string, url string, token string, ref string) error {

Describe alternatives you've considered
N/A

Additional context
N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions