mkdir testrepo
cd testrepo
exec git init --initial-branch=main .

cp ../src/v1.yml rules.yml
cp ../src/.pint.hcl .
env GIT_AUTHOR_NAME=pint
env GIT_AUTHOR_EMAIL=pint@example.com
env GIT_COMMITTER_NAME=pint
env GIT_COMMITTER_EMAIL=pint@example.com
exec git add .
exec git commit -am 'import rules and config'

exec git checkout -b v2
cp ../src/v2.yml rules.yml
exec git commit -am 'v2'

pint.error --no-color ci
! stdout .
cmp stderr ../stderr.txt

-- stderr.txt --
level=info msg="Loading configuration file" path=.pint.hcl
level=fatal msg="Fatal error" error="failed to get the list of modified files: exit status 128"
-- src/v1.yml --
- record: rule1
  expr: sum(foo) by(job)
- record: rule2
  expr: sum(foo) bi(job)

-- src/v2.yml --
- record: rule1
  expr: sum(bar) by(job)
- record: rule2
  expr: sum(bar) by(job)

-- src/.pint.hcl --
ci {
  baseBranch = "notmain"
}
