From 268e26a468c8026645e8f3f08e1cd28cdb0068ad Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Mon, 24 Feb 2020 07:16:15 +0100 Subject: [PATCH] Condition the hook and job processing --- src/deforaos-git-hook.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/deforaos-git-hook.sh b/src/deforaos-git-hook.sh index cb464b4..755e914 100755 --- a/src/deforaos-git-hook.sh +++ b/src/deforaos-git-hook.sh @@ -59,7 +59,7 @@ _jobs_branch() branch="$1" repository="$2" - if [ "$branch" = "master" ]; then + if [ "$branch" = "master" -a -n "$JOBS_BRANCH_MASTER" ]; then for job in $JOBS_BRANCH_MASTER; do $JOBS add "$job $repository" done @@ -85,7 +85,7 @@ while read line; do done #chain the hooks ret=0 -for hook in $HOOKS; do +[ -n "$HOOKS" ] && for hook in $HOOKS; do "_hook_$hook" < "$tmpfile" || ret=2 done #clean up