[PATCH 4/4] hooks--update.sample: use hash-agnostic null OID

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The update sample hook has the null 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 rev-parse --null-oid` so the sample hook becomes hash-agnostic.

Signed-off-by: Denton Liu <liu.denton@xxxxxxxxx>
---
 templates/hooks--update.sample | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/templates/hooks--update.sample b/templates/hooks--update.sample
index 5014c4b31c..5316362af5 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 rev-list --null-oid)"
 if [ "$newrev" = "$zero" ]; then
 	newrev_type=delete
 else
-- 
2.28.0.618.gf4bc123cb7




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux