#!/bin/bash # gentoo-infra: infra/githooks.git:update-04-utf8 # Copyright 2017-2021 Michał Górny and others # Distributed under the terms of the GNU General Public License v2 or later # Author: Michał Górny refname=$1 oldrev=$2 newrev=$3 export LC_MESSAGES=C # special cases zeros=0000000000000000000000000000000000000000 # branch removal [[ ${newrev} == "${zeros}" ]] && exit 0 rev_list_arg="${oldrev}..${newrev}" exec 10/dev/null then echo "Commit ${commithash} contains invalid UTF-8 in the commit metadata" ret=1 fi done < <(git rev-list "${rev_list_arg}" --stdin <&10) exit ${ret}