oopsies... should be checking for "-x" not just "-f or -l" to chain a hook

it was trying to execute a broken symlink!  (Thanks to Jeff of KDE for
catching this)
This commit is contained in:
Sitaram Chamarty 2011-05-28 20:26:55 +05:30
parent b706719a56
commit a6a0db10e9
3 changed files with 3 additions and 5 deletions

View file

@ -56,7 +56,7 @@ gitolite put your new hook in the correct place.
ADMIN_POST_UPDATE_CHAINS_TO=hooks/post-update.tertiary
if [[ -f $ADMIN_POST_UPDATE_CHAINS_TO || -L $ADMIN_POST_UPDATE_CHAINS_TO ]]; then
if [[ -x $ADMIN_POST_UPDATE_CHAINS_TO ]]; then
exec $ADMIN_POST_UPDATE_CHAINS_TO "$@"
fi

View file

@ -88,9 +88,7 @@ check_ref (\@allowed_refs, $ENV{GL_REPO}, $_ , $att_acc
# if we returned at all, all the checks succeeded. Check secondary hooks now
$UPDATE_CHAINS_TO ||= 'hooks/update.secondary';
( -f $UPDATE_CHAINS_TO or -l $UPDATE_CHAINS_TO )
and system ( $UPDATE_CHAINS_TO, @ARGV )
and die "$UPDATE_CHAINS_TO died\n";
-x $UPDATE_CHAINS_TO and system ( $UPDATE_CHAINS_TO, @ARGV ) and die "$UPDATE_CHAINS_TO died\n";
# now log it and exit 0 so git can get on with it
log_it("", "$att_acc\t" . substr($oldsha, 0, 14) . "\t" . substr($newsha, 0, 14) .

View file

@ -26,7 +26,7 @@ cd $od
ADMIN_POST_UPDATE_CHAINS_TO=`$GL_BINDIR/gl-query-rc ADMIN_POST_UPDATE_CHAINS_TO`
[ -n "$ADMIN_POST_UPDATE_CHAINS_TO" ] || ADMIN_POST_UPDATE_CHAINS_TO=hooks/post-update.secondary
if [ -f $ADMIN_POST_UPDATE_CHAINS_TO ] || [ -L $ADMIN_POST_UPDATE_CHAINS_TO ]
if [ -x $ADMIN_POST_UPDATE_CHAINS_TO ]
then
exec $ADMIN_POST_UPDATE_CHAINS_TO "$@"
fi