From 52cf1a3c3e8a0830816ed3d8b3648e112d0d97c2 Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Tue, 29 Aug 2017 03:03:59 -0400 Subject: Add tag op --- main.sh | 2 ++ repo-mutate.sh | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/main.sh b/main.sh index cfec2f5..d34f962 100644 --- a/main.sh +++ b/main.sh @@ -34,6 +34,8 @@ function main systr_status "$@" elif [[ "$cmd" == "commit" ]]; then systr_commit "$@" + elif [[ "$cmd" == "tag" ]]; then + systr_repo_tag "$@" else echo "Fatal: $1 not recognized" fi diff --git a/repo-mutate.sh b/repo-mutate.sh index e35424f..f2f90dd 100644 --- a/repo-mutate.sh +++ b/repo-mutate.sh @@ -123,3 +123,20 @@ function systr_repo_set_reference ssh "$remote" "systrunk set-ref \"$symref\" \"$commit\"" fi } + +## +# systr_repo_tag +# +# Tag the current commit. This creates a new branch which references +# BASE. +## +function systr_repo_tag +{ + if [ $# -lt 1 ]; then + echo "Fatal: too few arguments to systr_repo_tag" + exit 1 + fi + + name="$1" + systr_repo_set_reference "$name" "$BASE" +} -- cgit v1.2.3