#2953·skopeo

`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:

bash
if [ $(grep -r "^\(<<<<<<<\|>>>>>>>\|^=======$\)" $f) ]; then

Git 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:

bash
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=0

Expected: names conflicted.go, exits 1.

Not macOS-specific — the failure is in bash's [, not grep.

Source: podman-container-tools/skopeo