diff --git a/in_command.go b/in_command.go index 634ec82..f302fe7 100644 --- a/in_command.go +++ b/in_command.go @@ -199,10 +199,13 @@ func (c *InCommand) downloadFile(url, destPath string) error { func (c *InCommand) resolveTagToCommitSHA(tag string) (string, error) { reference, err := c.github.GetRef(tag) + if err != nil { + return "", err + } - if err != nil && *reference.Object.Type != "commit" { + if *reference.Object.Type != "commit" { fmt.Fprintln(c.writer, "could not resolve tag '%s' to commit: returned type is not 'commit' - only lightweight tags are supported") - return "", nil + return "", err } return *reference.Object.SHA, err