#!/bin/sh
set -eu

usage () {
    cat <<'EOF'
usage: git is-ancestor <branch> <branch>

Returns whether the first branch is an ancestor of the second.
Will return with an exit code of 0 or 1.
EOF
}

if [ $# -eq 2 ]; then
    first=$1
    second=$2
else
    usage >&2
    exit 2
fi

git contains "$second" "$first"
