summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2018-05-02 00:26:08 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-05-02 04:59:53 (GMT)
commit03a7f388dafaee0aa084144efe7a8f9c151e5221 (patch)
treee31007a046fd6f661af5df6d6d47cf747401823f /templates
parente1ccd7e2b1cae8d7dab4686cddbd923fb6c46953 (diff)
downloadgit-03a7f388dafaee0aa084144efe7a8f9c151e5221.zip
git-03a7f388dafaee0aa084144efe7a8f9c151e5221.tar.gz
git-03a7f388dafaee0aa084144efe7a8f9c151e5221.tar.bz2
Update shell scripts to compute empty tree object ID
Several of our shell scripts hard-code the object ID of the empty tree. To avoid any problems when changing hashes, compute this value on startup of the script. For performance, store the value in a variable and reuse it throughout the life of the script. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'templates')
-rwxr-xr-xtemplates/hooks--pre-commit.sample2
1 files changed, 1 insertions, 1 deletions
diff --git a/templates/hooks--pre-commit.sample b/templates/hooks--pre-commit.sample
index 68d62d5..6a75641 100755
--- a/templates/hooks--pre-commit.sample
+++ b/templates/hooks--pre-commit.sample
@@ -12,7 +12,7 @@ then
against=HEAD
else
# Initial commit: diff against an empty tree object
- against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
+ against=$(git hash-object -t tree /dev/null)
fi
# If you want to allow non-ASCII filenames set this variable to true.