aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKylie McClain <kylie@somas.is>2020-06-30 16:23:31 -0400
committerKylie McClain <kylie@somas.is>2020-06-30 16:23:31 -0400
commit78f87d11feb09146ce1d63b6568e499ae4bea386 (patch)
tree9c054a2c2df3a051beafc5e8f074bc40a17d03fe
parentf1e10ea2451b0c8e7b22e3d538f9343c7bc2112f (diff)
downloadgitolite-admin-78f87d11feb09146ce1d63b6568e499ae4bea386.tar.gz
gitolite-admin-78f87d11feb09146ce1d63b6568e499ae4bea386.tar.xz
gitolite-admin-78f87d11feb09146ce1d63b6568e499ae4bea386.zip
fix_default_branch: only run when there's one branch
-rwxr-xr-xlocal/triggers/POST_GIT/fix_default_branch.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/local/triggers/POST_GIT/fix_default_branch.sh b/local/triggers/POST_GIT/fix_default_branch.sh
index 0c7c5ab..ee5173a 100755
--- a/local/triggers/POST_GIT/fix_default_branch.sh
+++ b/local/triggers/POST_GIT/fix_default_branch.sh
@@ -3,7 +3,7 @@
cd /srv/git/repositories/"$2".git
branch_count=$(git branch | wc -l)
-[ "${branch_count}" -le 2 ] || exit
+[ "${branch_count}" -eq 1 ] || exit
git for-each-ref --format='%(refname:short)' refs/heads/ | sort -d | while read -r branch; do
case "${branch}" in
main|master) : ;;