diff --git a/cmd/hook/pre_run_e.go b/cmd/hook/pre_run_e.go index af5fbdbc..1dd4f2af 100644 --- a/cmd/hook/pre_run_e.go +++ b/cmd/hook/pre_run_e.go @@ -3,6 +3,8 @@ package hook import ( "context" + "github.com/pkg/errors" + "github.com/giantswarm/gitrepo/pkg/gitrepo" "github.com/giantswarm/microerror" "github.com/spf13/cobra" @@ -37,7 +39,7 @@ func PreRunE(cmd *cobra.Command, args []string) error { } defaultTag, err := repo.HeadTag(ctx) - if gitrepo.IsReferenceNotFound(err) { + if errors.Is(err, &gitrepo.ReferenceNotFoundError{}) { defaultTag = "" } else if err != nil { return microerror.Mask(err) diff --git a/go.mod b/go.mod index a3a2dc9a..e990f358 100644 --- a/go.mod +++ b/go.mod @@ -6,9 +6,10 @@ toolchain go1.22.5 require ( github.com/giantswarm/app/v7 v7.0.2 - github.com/giantswarm/gitrepo v0.2.4 + github.com/giantswarm/gitrepo v0.3.0 github.com/giantswarm/microerror v0.4.1 github.com/google/go-cmp v0.6.0 + github.com/pkg/errors v0.9.1 github.com/spf13/afero v1.11.0 github.com/spf13/cobra v1.8.1 sigs.k8s.io/yaml v1.4.0 diff --git a/go.sum b/go.sum index d1013d32..546f46ec 100644 --- a/go.sum +++ b/go.sum @@ -28,8 +28,8 @@ github.com/giantswarm/apiextensions-application v0.6.2 h1:XL86OrpprWl5Wp38EUvUXt github.com/giantswarm/apiextensions-application v0.6.2/go.mod h1:8ylqSmDSzFblCppRQTFo8v9s/F6MX6RTusVVoDDfWso= github.com/giantswarm/app/v7 v7.0.2 h1:3RYA/4kwsK+yLS4vD5A7FjiEaplvq85jATCecni5I7o= github.com/giantswarm/app/v7 v7.0.2/go.mod h1:2sBTL8q40MSdzpLuz6foEv/zZKT+IpGxBWRDzm4nmc0= -github.com/giantswarm/gitrepo v0.2.4 h1:lTbKpn8kE3HHJeWSO8r1/KuVNjRIwogrOzWV/HQcEFM= -github.com/giantswarm/gitrepo v0.2.4/go.mod h1:FTNHp5FE/PJWKCfYABYPICWJY9n4/J29KoumuauX7yU= +github.com/giantswarm/gitrepo v0.3.0 h1:GpzujGetLsMkbFBMwaYQJ+qMUvbErOkU9kNmkb+p9JI= +github.com/giantswarm/gitrepo v0.3.0/go.mod h1:Isv0Cf/Sd+R66WSFrdIvqmxAw2PxD5ixXnAXYKkRjh0= github.com/giantswarm/k8smetadata v0.25.0 h1:6mKmmm4xHPuBvxDMAkIhU5oj6KJkJSaR2s5esIsnHs4= github.com/giantswarm/k8smetadata v0.25.0/go.mod h1:QiQAyaZnwco1U0lENLF0Kp4bSN4dIPwIlHWEvUo3ES8= github.com/giantswarm/microerror v0.4.1 h1:WMiD7HQASoUA9lZzPlPK+erCEOJ0uT4cyo18VfCXHD0=