From: Denton Liu Date: Wed, 23 Sep 2020 09:38:45 +0000 (-0700) Subject: hooks--update.sample: use hash-agnostic zero OID X-Git-Tag: v2.29.0-rc0~36^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d8d3d632f4165955da49032d50279c20cfbde2e5;p=thirdparty%2Fgit.git hooks--update.sample: use hash-agnostic zero OID The update sample hook has the zero OID hardcoded as 40 zeros. However, with the introduction of SHA-256 support, this assumption no longer holds true. Replace the hardcoded $z40 with a call to git hash-object --stdin Signed-off-by: Junio C Hamano --- diff --git a/templates/hooks--update.sample b/templates/hooks--update.sample index 5014c4b31c..c4d426bc6e 100755 --- a/templates/hooks--update.sample +++ b/templates/hooks--update.sample @@ -60,7 +60,7 @@ esac # --- Check types # if $newrev is 0000...0000, it's a commit to delete a ref. -zero="0000000000000000000000000000000000000000" +zero=$(git hash-object --stdin