#!/bin/sh
+# Copyright (c) 2016-2019 The Zcash developers
+# Copyright (c) 2012-2019 The Bitcoin Core developers
+# Copyright (c) 2012-2019 Bitcoin Developers
+# Distributed under the MIT software license, see the accompanying
+# file COPYING or http://www.opensource.org/licenses/mit-license.php .
+
if [ $# -gt 1 ]; then
cd "$2"
fi
# if latest commit is tagged and not dirty, then override using the tag name
RAWDESC=$(git describe --abbrev=0 2>/dev/null)
- if [ "$(git rev-parse HEAD)" = "$(git rev-list -1 $RAWDESC)" ]; then
+ if [ "$(git rev-parse HEAD)" = "$(git rev-list -1 $RAWDESC 2>/dev/null)" ]; then
git diff-index --quiet HEAD -- && DESC=$RAWDESC
fi