newrev="$1"
branch="$2"
branch_hash=$(git rev-parse $branch)
- match=$(git rev-list $newrev | grep $branch_hash)
+ match=$(git rev-list -1 $branch_hash ^$newrev)
- if [ -n "$match" ]; then
+ if [ -z "$match" ]; then
return 0
else
return 1
commit_message="Split '$dir/' into commit '$latest_new'"
fi
cat <<-EOF
- $message
+ $commit_message
git-subtree-dir: $dir
git-subtree-mainline: $latest_old