Skip to content

Commit

Permalink
fix: add a debug log on git config
Browse files Browse the repository at this point in the history
refs #2537

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
  • Loading branch information
caarlos0 committed Sep 28, 2021
1 parent 2b64600 commit 0c51988
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions internal/git/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func ExtractRepoFromConfig() (result config.Repo, err error) {
if err != nil {
return result, fmt.Errorf("no remote configured to list refs from")
}
log.Debugf("got raw git url: %q", out)
log.WithField("rawurl", string(out)).Debugf("got git url")
return ExtractRepoFromURL(out)
}

Expand Down Expand Up @@ -57,8 +57,10 @@ func ExtractRepoFromURL(rawurl string) (config.Repo, error) {
if len(ss) < 2 {
return config.Repo{}, fmt.Errorf("unsupported repository URL: %s", rawurl)
}
return config.Repo{
repo := config.Repo{
Owner: strings.Join(ss[:len(ss)-1], "/"),
Name: ss[len(ss)-1],
}, nil
}
log.WithField("owner", repo.Owner).WithField("name", repo.Name).Debugf("parsed url")
return repo, nil
}

0 comments on commit 0c51988

Please sign in to comment.