Skip to content

Commit

Permalink
contrib/hooks/post-receive-email: fix return values from prep_for_email
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
alanraison authored and gitster committed Dec 9, 2010
1 parent f34e9ed commit 8828aa3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions contrib/hooks/post-receive-email
Expand Up @@ -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

Expand All @@ -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
}

#
Expand Down

0 comments on commit 8828aa3

Please sign in to comment.