`hack/validate-git-marks.sh` does not detect conflict markers
Author: ROKUMATECreated Aug 12, 2026Updated Sep 12, 2026
Labelsstale-issue
make validate-local runs this script on every PR to catch leftover merge conflict markers.
It never catches any.
Line 9 tests grep's output instead of its exit status:
if [ $(grep -r "^\(<<<<<<<\|>>>>>>>\|^=======$\)" $f) ]; thenGit writes markers with a label (<<<<<<< HEAD), so the unquoted substitution hands [ two
or more arguments. [ fails with "too many arguments" and exits non-zero, so the if is
false and the file is never flagged.
Reproduce:
T=$(mktemp -d); cd "$T"; git init -q .; git config user.email t@t; git config user.name t
printf 'a\n<<<<<<< HEAD\nmine\n=======\ntheirs\n>>>>>>> feature\n' > conflicted.go
git add -A; git commit -qm t
bash /path/to/skopeo/hack/validate-git-marks.sh; echo "rc=$?"Got:
validate-git-marks.sh: line 9: [: too many arguments
Congratulations! There is no conflict.
rc=0Expected: names conflicted.go, exits 1.
Not macOS-specific — the failure is in bash's [, not grep.
Source: podman-container-tools/skopeo