> Which is what Joseph said, I think. The problem was that the
> update_hook script still gets called for branch deletions, and it was
> rejecting them. My fix was just to stop rejecting them:
> 
> Author: Jonathan Wakely <jwak...@redhat.com>
> Date:   Thu Oct 1 18:04:54 2020 +0000
> 
>    Do not check anything for ref deletions
> 
> diff --git a/update_hook b/update_hook
> index 8b342b5..a392230 100755
> --- a/update_hook
> +++ b/update_hook
> @@ -12,6 +12,9 @@ def main():
>     ref_name = sys.argv[1]
>     old_object = sys.argv[2]
>     new_object = sys.argv[3]
> +    if re.fullmatch('0+', new_object) is not None:
> +        # This is a branch deletion.
> +        sys.exit(0)
>     # Do not allow updates introducing ancestry based on the old
>     # git-svn repository, to ensure people rebase onto the new history
>     # rather than merging branches based on git-svn history into those
> 
> 
> 
> Maybe the hooks.update-hook script should not be called at all for ref
> deletions, if they are meant to be handled elsewhere.

Thanks for explaining the context; the script was being called by
the git-hooks via the update-hook config option. I understand better,
now, and the way you handled it seems right to me.

-- 
Joel

Reply via email to