1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-04-11 11:42:15 +02:00

fix: add a debug log on git config

refs #2537

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
This commit is contained in:
Carlos Alexandro Becker 2021-09-28 10:48:49 -03:00
parent 2b646008f4
commit 0c51988ff1
No known key found for this signature in database
GPG Key ID: E61E2F7DC14AB940

View File

@ -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)
}
@ -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
}