exec git init
exec git config user.email i@example.com
exec git config user.name someone
exec git checkout -b main

exec git add file
exec git commit -m 'initial commit'

# On 'main', add a second line
exec sed -i '1 a\line2' file
exec git add file
exec git commit -m 'add line2'

# On 'branch', remove the file
exec git checkout -b branch HEAD~1
exec git rm file
exec git commit -m 'remove file'

# Merge branch into main
exec git checkout main
! exec git merge branch
exec git status --porcelain --branch
stdout '## main\nUD file'

env WANT_STATUS='NumConflicts=1 LocalBranch=main HEAD=[a-f0-9]{7} State=Merging'
gitstatus
! stderr .

-- file --
line1