#!/bin/sh

set -eufx

# rm -rf repo
git init repo

cd repo
git checkout --orphan main
mkdir -p dir/subdir
echo 1 > dir/subdir/file
git add dir
git commit -m "Initial commit"
git checkout -b renamed
git mv dir renamed-dir
git commit -m "Rename directory"
git checkout main
git rm -r dir/subdir
mkdir dir
ln -s /dev/null dir/subdir
git add dir/subdir
git commit -m "Replace with symlink"
git rebase renamed
# succeeds:
# git rebase --strategy=recursive renamed
