Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2018-05-02 03:26:08 +0300
committerJunio C Hamano <gitster@pobox.com>2018-05-02 07:59:53 +0300
commit03a7f388dafaee0aa084144efe7a8f9c151e5221 (patch)
treee31007a046fd6f661af5df6d6d47cf747401823f /git-filter-branch.sh
parente1ccd7e2b1cae8d7dab4686cddbd923fb6c46953 (diff)
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 'git-filter-branch.sh')
-rwxr-xr-xgit-filter-branch.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/git-filter-branch.sh b/git-filter-branch.sh
index 64f21547c1..ccceaf19a7 100755
--- a/git-filter-branch.sh
+++ b/git-filter-branch.sh
@@ -11,6 +11,8 @@
# The following functions will also be available in the commit filter:
functions=$(cat << \EOF
+EMPTY_TREE=$(git hash-object -t tree /dev/null)
+
warn () {
echo "$*" >&2
}
@@ -46,7 +48,7 @@ git_commit_non_empty_tree()
{
if test $# = 3 && test "$1" = $(git rev-parse "$3^{tree}"); then
map "$3"
- elif test $# = 1 && test "$1" = 4b825dc642cb6eb9a060e54bf8d69288fbee4904; then
+ elif test $# = 1 && test "$1" = $EMPTY_TREE; then
:
else
git commit-tree "$@"