#!/usr/bin/env python
import sys
from subprocess import check_output

content = check_output(['git', 'grep', '--cached', '-l', '-I', '^replace', '--', 'go.mod']).decode().strip()
if "go.mod" in content:
    print("found non-commented 'replace' entry, cannot commit")
    sys.exit(1)
else:
    print("debug-printing content, see below:\n\n{0}".format(content))
