Skip to content

Commit 8828aa3

Browse files
alanraisongitster
authored andcommitted
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 <[email protected]> Acked-by: Kevin P. Fleming <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f34e9ed commit 8828aa3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

contrib/hooks/post-receive-email

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,13 @@ prep_for_email()
144144
short_refname=${refname##refs/remotes/}
145145
echo >&2 "*** Push-update of tracking branch, $refname"
146146
echo >&2 "*** - no email generated."
147-
exit 0
147+
return 1
148148
;;
149149
*)
150150
# Anything else (is there anything else?)
151151
echo >&2 "*** Unknown type of update to $refname ($rev_type)"
152152
echo >&2 "*** - no email generated"
153-
return 0
153+
return 1
154154
;;
155155
esac
156156

@@ -166,10 +166,10 @@ prep_for_email()
166166
esac
167167
echo >&2 "*** $config_name is not set so no email will be sent"
168168
echo >&2 "*** for $refname update $oldrev->$newrev"
169-
return 0
169+
return 1
170170
fi
171171

172-
return 1
172+
return 0
173173
}
174174

175175
#

0 commit comments

Comments
 (0)