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

cp ../src/alert.yml alert.yml
cp ../src/record.yml record.yml
exec ln -s record.yml symlink.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
exec rm symlink.yml
exec git add symlink.yml
exec git commit -am 'remove symlink'

# No warning should be reported when removing a symlink,
# only the real file removal should trigger the warning.
exec pint -l error --offline --no-color ci
! stdout .
cmp stderr ../stderr.txt

-- stderr.txt --
-- src/alert.yml --
groups:
- name: alerts
  rules:
  - alert: Alert
    expr: 'up:sum == 0'
-- src/record.yml --
groups:
- name: recordings
  rules:
  - record: up:sum
    expr: sum(up)
-- src/.pint.hcl --
ci {
  baseBranch = "main"
}
parser {
  include = [".+.yml"]
}
