#! /bin/sh
set -e -x
git init test
cd test
# Add a file containing AAAXAAA (one letter on each line).
printf 'A\nA\nA\nX\nA\nA\nA\n' > bla
git add bla
git commit -m bla
git branch branch
# Rename bla to blub.
# Without the rename, the merge succeeds, too (appending Bs to bla, of course).
git mv bla blub
git commit -m blub
# Append 100 lines containing one B each.
printf 'B\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\nB\n' >> blub
# If only few Bs are appended, the merge succeeds (one more B makes it fail).
#printf 'B\nB\nB\n' >> blub
git commit -a -m B
# Replace the X by Z on the branch.
git checkout branch
printf 'A\nA\nA\nZ\nA\nA\nA\n' > bla
git commit -a -m Z
# Try to merge branch into master, fails with delete-modify-conflict.
git checkout master
git merge branch