From 2ceeb1baef56a1aa49db4d43fb3160d8a2832f39 Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Tue, 29 Aug 2017 02:22:03 -0400 Subject: Update commit op Disallow commits to any reserved names except for HEAD --- commit.sh | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/commit.sh b/commit.sh index f06124c..b85ddff 100644 --- a/commit.sh +++ b/commit.sh @@ -48,11 +48,25 @@ function systr_record_commit_mesg function systr_commit { if [ $# -ne 0 ]; then - branch=$1 + branch="$1" else branch="$TRAC" fi + if [[ "$branch" == "BASE" ]]; then + echo "Fatal: bad branch name" + exit 1 + elif [[ "$branch" == "TRAC" ]]; then + echo "Fatal: bad branch name" + exit 1 + elif [[ "$branch" == "NULL" ]]; then + echo "Fatal: bad branch name" + exit 1 + elif [[ "$branch" == "MERG" ]]; then + echo "Fatal: bad branch name" + exit 1 + fi + branchcommit=$(systr_repo_resolve_reference "$branch") || branchcommit="$BASE" if [[ "$BASE" != "$branchcommit" ]]; then -- cgit v1.2.3