# Setup
cd $TVH_ROOT || exit 1
-git checkout $1 && git checkout . || exit 1
NOW=`date -R`
CHANGELOG=$TVH_ROOT/debian/changelog
VERFILE=$TVH_ROOT/src/version.c
+# Checkout
+git checkout $REL || die "could not checkout $REL"
+git clean -dfx || die "could not clean git tree"
+
# Create version file
VER=$($TVH_ROOT/support/version $VERFILE)
# Arguments
REL=$1
+
+# Checkout
if [ ! -z "$REL" ]; then
git checkout $REL || die "could not checkout $REL"
fi
-
-# Clean
-git checkout . || die "could not clean git tree"
+git clean -dfx || die "could not clean git tree"
# Version
VER=$(./support/version)