File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 1313# hooks.allowdeletetag
1414# This boolean sets whether deleting tags will be allowed in the
1515# repository. By default they won't be.
16+ # hooks.allowmodifytag
17+ # This boolean sets whether a tag may be modified after creation. By default
18+ # it won't be.
1619# hooks.allowdeletebranch
1720# This boolean sets whether deleting branches will be allowed in the
1821# repository. By default they won't be.
@@ -44,6 +47,7 @@ allowunannotated=$(git config --bool hooks.allowunannotated)
4447allowdeletebranch=$( git config --bool hooks.allowdeletebranch)
4548denycreatebranch=$( git config --bool hooks.denycreatebranch)
4649allowdeletetag=$( git config --bool hooks.allowdeletetag)
50+ allowmodifytag=$( git config --bool hooks.allowmodifytag)
4751
4852# check for no description
4953projectdesc=$( sed -e ' 1q' " $GIT_DIR /description" )
@@ -82,6 +86,12 @@ case "$refname","$newrev_type" in
8286 ;;
8387 refs/tags/* ,tag)
8488 # annotated tag
89+ if [ " $allowmodifytag " != " true" ] && git rev-parse $refname > /dev/null 2>&1
90+ then
91+ echo " *** Tag '$refname ' already exists." >&2
92+ echo " *** Modifying a tag is not allowed in this repository." >&2
93+ exit 1
94+ fi
8595 ;;
8696 refs/heads/* ,commit)
8797 # branch
You can’t perform that action at this time.
0 commit comments