@matheusbsbs / matheus-bagliano / commits / 8828aa3418
Fork 0

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 <alan@theraisons.me.uk> Acked-by: Kevin P. Fleming <kpfleming@digium.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Alan Raison committed Dec 9, 2010 at 16:03 UTC 8828aa3418792ff9deb2ab264c6934a5d0bb15e0
1 file changed +4 -4
contrib/hooks/post-receive-email
+4 -4
@@ -144,13 +144,13 @@ prep_for_email()
144 short_refname=${refname##refs/remotes/}
145 echo >&2 "*** Push-update of tracking branch, $refname"
146 echo >&2 "*** - no email generated."
147 - exit 0
147 + return 1
148 ;;
149 *)
150 # Anything else (is there anything else?)
151 echo >&2 "*** Unknown type of update to $refname ($rev_type)"
152 echo >&2 "*** - no email generated"
153 - return 0
153 + return 1
154 ;;
155 esac
156
@@ -166,10 +166,10 @@ prep_for_email()
166 esac
167 echo >&2 "*** $config_name is not set so no email will be sent"
168 echo >&2 "*** for $refname update $oldrev->$newrev"
169 - return 0
169 + return 1
170 fi
171
172 - return 1
172 + return 0
173 }
174
175 #