gopkg.in/yaml.v2 error in Hugo 0.18.1 from AUR

Building the latest Hugo release from AUR (Arch User Repository) fails with the following error message:

cd .; git clone https://gopkg.in/yaml.v2 /home/roger/packages/hugo/src/.cache/govendor/gopkg.in/yaml.v2
Cloning into '/home/roger/packages/hugo/src/.cache/govendor/gopkg.in/yaml.v2'...
error: RPC failed; HTTP 301 curl 22 The requested URL returned error: 301
fatal: The remote end hung up unexpectedly
Error: Remotes failed for:
Failed for "gopkg.in/yaml.v2" (failed to clone repo): exit status 128

The error is supposedly caused by a change with the latest git release where git no longer follows redirects by default and thus “breaks” gopkg.in. The issue is discussed further at https://github.com where a git-config workaround is offered.

Another workaround is to simply clone go-yaml directly from github.com after the initial build fails:

git clone https://github.com/go-yaml/yaml.git /home/roger/packages/hugo/src/.cache/govendor/gopkg.in/yaml.v2

Apply the makepkg command again and Hugo will build successfully.