]> git.maquefel.me Git - brevno-suite/hugo/commit
create: Fix non-deterministic conflict detection in hugo new content
authorJoe Mooring <joe.mooring@veriphor.com>
Fri, 17 Apr 2026 21:22:26 +0000 (14:22 -0700)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sat, 18 Apr 2026 13:06:28 +0000 (15:06 +0200)
commit6436deb3e19c279c23aa9caf67b65e44d863b872
tree4055c3622713759134aaf6ca94dc2f9c942928e0
parent547ab29ced1985e101bc5365e82cee4c481e5db9
create: Fix non-deterministic conflict detection in hugo new content

The contentInclusionFilter used strings.Contains to match filenames
against the target path. Because strings.Contains is a substring check,
a directory entry like "content/about" matches "content/about.md",
causing unrelated files to be pulled into the mini-build. Whether the
conflict was then detected depended on whether the filesystem walker
delivered a directory entry or a full file path.

Also adds an upfront check for the directory-conflict case, since
a corrected filter alone would allow about.md to be created alongside
an existing about/ directory.

Closes #12602
Closes #12786
Closes #14112
Closes #14769

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
create/content.go
testscripts/commands/new_content.txt