diff options
author | Paulo Gomes <pjbgf@linux.com> | 2023-12-01 09:21:30 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-01 09:21:30 +0000 |
commit | cc1895b905ebadb09504d88444ff05932fa6e928 (patch) | |
tree | 4407dac9eb1960679355ded29df421cf533d2140 /config/config.go | |
parent | d87110b492c94d99ebdaea732b23a54b7efba94b (diff) | |
parent | de1d5a5978b9599ca3dacd58bbf699e4bb4cf6bd (diff) | |
download | go-git-cc1895b905ebadb09504d88444ff05932fa6e928.tar.gz |
Merge pull request #950 from aymanbagabas/validate-ref
git: validate reference names (#929)
Diffstat (limited to 'config/config.go')
-rw-r--r-- | config/config.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/config/config.go b/config/config.go index da425a7..6d41c15 100644 --- a/config/config.go +++ b/config/config.go @@ -13,6 +13,7 @@ import ( "github.com/go-git/go-billy/v5/osfs" "github.com/go-git/go-git/v5/internal/url" + "github.com/go-git/go-git/v5/plumbing" format "github.com/go-git/go-git/v5/plumbing/format/config" ) @@ -614,7 +615,7 @@ func (c *RemoteConfig) Validate() error { c.Fetch = []RefSpec{RefSpec(fmt.Sprintf(DefaultFetchRefSpec, c.Name))} } - return nil + return plumbing.NewRemoteHEADReferenceName(c.Name).Validate() } func (c *RemoteConfig) unmarshal(s *format.Subsection) error { |