Fixed typo.
[dcp.git] / dcp-recent
CommitLineData
44955b68 1#!/bin/bash
a69a41b1
FT
2
3set -e
4
5usage() {
6 echo "usage: dcp-recent REPODIR"
7}
8
9rungit() {
10 (
11 cd "$repodir"
12 git "$@"
13 ) || false
14}
15
16if [ $# -lt 1 ]; then
17 usage >&2
18 exit 1
19fi
20
21repodir="$1"
22shift
23
24if [ ! -d "$repodir" ]; then
25 echo "dcp-recent: cannot find $repodir" >&2
26 exit 1
27fi
28
29if ! rungit tag -l | grep -q ^lastbuild$; then
30 exit 1
31fi
32
33lastbuild="$(rungit rev-parse lastbuild)"
34master="$(rungit rev-parse master)"
35
36[ "$master" = "$lastbuild" ]