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

# We need an initial commit
exec git commit -m 'initial commit' --allow-empty

# On 'main', add line1 into a file
cp file1 file
exec git add file
exec git commit -m 'add line1 into file'

# On 'branch', remove the file
exec git checkout -b branch HEAD~1
cp file2 file
exec git add file
exec git commit -m 'add line2 into file'

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

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

-- file1 --
line1

-- file2 --
line2

-- .gitignore --
file1
file2
# Ignore .gitignore so it doesn't show in git status
.gitignore