Environment:
$ hugo env
hugo v0.123.4-21a41003c4633b142ac565c52da22924dc30637a+extended windows/amd64 BuildDate=2024-02-26T16:33:05Z VendorInfo=gohugoio
GOOS="windows"
GOARCH="amd64"
GOVERSION="go1.22.0"
github.com/sass/libsass="3.6.5"
github.com/webmproject/libwebp="v1.3.2"
How to reproduce:
Command prompt 1:
git clone --single-branch --branch temp1 https://github.com/deining/vitalcontrol.de.git
cd vitalcontrol.de
hugo server
Now open another command prompt and issue there:
git checkout temp0
The hugo instance in prompt 1 crashes:
panic: runtime error: index out of range [11] with length 11
goroutine 40 [running]:
github.com/gohugoio/hugo/hugolib.(*HugoSites).fileEventsContentPaths(0xc00f7a7c70?, {0xc005baf300?, 0x0?, 0xc00077e6c0?})
/root/project/hugo/hugolib/site.go:489 +0xc5f
github.com/gohugoio/hugo/hugolib.(*HugoSites).processPartial(0xc0007cf7c0, {0x4daff18, 0x60f4a00}, {0x4db8770, 0xc0008bac00}, 0xc00895fb80, 0xc001f937a8, {0xc006ed0008, 0x24, 0x25})
/root/project/hugo/hugolib/hugo_sites_build.go:867 +0xbfb
github.com/gohugoio/hugo/hugolib.(*HugoSites).process(0xc0007cf7c0, {0x4daff18, 0x60f4a00}, {0x4db8770?, 0xc0008bac00?}, 0xc00895fb80, 0xc001f937a8, {0xc006ed0008, 0x24, 0x25})
/root/project/hugo/hugolib/hugo_sites_build.go:234 +0x15f
github.com/gohugoio/hugo/hugolib.(*HugoSites).Build.func4()
/root/project/hugo/hugolib/hugo_sites_build.go:141 +0xbd
github.com/gohugoio/hugo/hugolib.(*HugoSites).Build(0xc0007cf7c0, {0x0, 0x0, 0x0, 0x0, 0xc000b11740, 0x0, 0x1, 0x0}, {0xc006ed0008, ...})
/root/project/hugo/hugolib/hugo_sites_build.go:152 +0x653
github.com/gohugoio/hugo/commands.(*hugoBuilder).rebuildSites(0xc000b16e80, {0xc006ed0008, 0x24, 0x25})
/root/project/hugo/commands/hugobuilder.go:1007 +0x188
github.com/gohugoio/hugo/commands.(*hugoBuilder).handleEvents.func6(0xc000b16e80, 0xc00993c3c0)
/root/project/hugo/commands/hugobuilder.go:859 +0x8e
github.com/gohugoio/hugo/commands.(*hugoBuilder).handleEvents(0xc000b16e80, 0xc000c86930, 0xc000e0e988, {0xc00024ee08, 0x26, 0x4a}, 0xc000dc6150)
/root/project/hugo/commands/hugobuilder.go:862 +0x139c
github.com/gohugoio/hugo/commands.(*hugoBuilder).newWatcher.func2()
/root/project/hugo/commands/hugobuilder.go:347 +0x25d
created by github.com/gohugoio/hugo/commands.(*hugoBuilder).newWatcher in goroutine 1
/root/project/hugo/commands/hugobuilder.go:338 +0x4c5
I could reproduce this on my Windows system only, not with my Ubuntu linux box.