From fda9f37b3a7f900b51381d3cfd5c1396e6f7b366 Mon Sep 17 00:00:00 2001 From: Sitaram Chamarty Date: Sun, 19 Jun 2011 06:54:52 +0530 Subject: [PATCH] die() needs to be defined in post-update hook (and in one other place it needs to be defined earlier) I never caught this because in my testing those error conditions -- caused by lack of afc3a06 -- never came up. --- contrib/adc/adc.common-functions | 4 ++-- hooks/gitolite-admin/post-update | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/contrib/adc/adc.common-functions b/contrib/adc/adc.common-functions index 240c521..d61f237 100644 --- a/contrib/adc/adc.common-functions +++ b/contrib/adc/adc.common-functions @@ -23,6 +23,8 @@ GL_FORKED_FROM="gl-forked-from" # ------------------------------------------------------------------------------ +die() { echo "$@"; exit 1; } + # test an option value more concisely opt() { [ "$1" = "1" ] && return 0 @@ -39,8 +41,6 @@ valid_owned_repo() { cd $GL_REPO_BASE_ABS } -die() { echo "$@"; exit 1; } - # NOTE: this also sets $repo to the normalised (without .git suffix) reponame get_rights_and_owner() { local ans diff --git a/hooks/gitolite-admin/post-update b/hooks/gitolite-admin/post-update index 62cd647..98c0dcd 100755 --- a/hooks/gitolite-admin/post-update +++ b/hooks/gitolite-admin/post-update @@ -1,5 +1,7 @@ #!/bin/sh +die() { echo "$@"; exit 1; } >&2 + [ -z "$GL_RC" ] && die "ENV GL_RC not set" [ -z "$GL_BINDIR" ] && die "ENV GL_BINDIR not set" [ -z "$GL_ADMINDIR" ] && die "ENV GL_ADMINDIR not set"