Commit 0ebab191 authored by Pfeiffer, Götz's avatar Pfeiffer, Götz
Browse files Abort when repos have no common commits.

parent c271d24a
......@@ -48,6 +48,11 @@ OTHERREPO=$(readlink -e $OTHERREPO)
# get the last common commit hash of the two repos:
COMMIT=$(comm --nocheck-order -12 <(git -C "$MYREPO" log --reverse --pretty=format:"%H") <(git -C "$OTHERREPO" log --reverse --pretty=format:"%H") | tail -n 1)
if [ -z "$COMMIT" ]; then
echo "ERROR, $MYREPO and $OTHERREPO have no common commits" >&2
exit 1
# go to last common commit:
git checkout $COMMIT
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment