From: Alan Raison Date: Thu, 9 Dec 2010 16:03:05 +0000 (+0000) Subject: contrib/hooks/post-receive-email: fix return values from prep_for_email X-Git-Tag: v1.7.3.4~31 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=8828aa3418792ff9deb2ab264c6934a5d0bb15e0;p=git.git contrib/hooks/post-receive-email: fix return values from prep_for_email The function was returning 0 for failure and 1 for success which was breaking the logic in the main loop. It now also returns in all cases, rather than exiting. Signed-off-by: Alan Raison Acked-by: Kevin P. Fleming Signed-off-by: Junio C Hamano --- diff --git a/contrib/hooks/post-receive-email b/contrib/hooks/post-receive-email index 85724bfc0..f99ea9585 100755 --- a/contrib/hooks/post-receive-email +++ b/contrib/hooks/post-receive-email @@ -144,13 +144,13 @@ prep_for_email() short_refname=${refname##refs/remotes/} echo >&2 "*** Push-update of tracking branch, $refname" echo >&2 "*** - no email generated." - exit 0 + return 1 ;; *) # Anything else (is there anything else?) echo >&2 "*** Unknown type of update to $refname ($rev_type)" echo >&2 "*** - no email generated" - return 0 + return 1 ;; esac @@ -166,10 +166,10 @@ prep_for_email() esac echo >&2 "*** $config_name is not set so no email will be sent" echo >&2 "*** for $refname update $oldrev->$newrev" - return 0 + return 1 fi - return 1 + return 0 } #