#!/bin/bash set -e usage() { echo "usage: dcp-recent REPODIR" } rungit() { ( cd "$repodir" git "$@" ) || false } if [ $# -lt 1 ]; then usage >&2 exit 1 fi repodir="$1" shift if [ ! -d "$repodir" ]; then echo "dcp-recent: cannot find $repodir" >&2 exit 1 fi if ! rungit tag -l | grep -q ^lastbuild$; then exit 1 fi lastbuild="$(rungit rev-parse lastbuild)" master="$(rungit rev-parse master)" [ "$master" = "$lastbuild" ]