#!/bin/sh -e
#
# git diff-conflicts BRANCH - which changes block merge of BRANCH?

branch=${1?what to merge?}

# shellcheck disable=SC2046,SC2086,SC2312
git diff -- $(
  {
    git diff-tree -r --name-only "${branch}" "$(git merge-base HEAD ${branch})"
    git ls-files --modified
  } | sort | uniq -d
)
