[PATCH 04/18] lib-submodule-update.sh: replace sha1 by hash
From: Stefan Beller <hidden>
Date: 2017-03-06 21:08:57
Subsystem:
the rest · Maintainer:
Linus Torvalds
From: Stefan Beller <hidden>
Date: 2017-03-06 21:08:57
Subsystem:
the rest · Maintainer:
Linus Torvalds
Cleaning up code by generalising it. Currently the mailing list discusses yet again how to migrate away from sha1. Signed-off-by: Stefan Beller <redacted> --- t/lib-submodule-update.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/t/lib-submodule-update.sh b/t/lib-submodule-update.sh
index 00128f28b5..f52c49c838 100755
--- a/t/lib-submodule-update.sh
+++ b/t/lib-submodule-update.sh@@ -171,9 +171,9 @@ reset_work_tree_to () { git checkout -f "$1" && git status -u -s >actual && test_must_be_empty actual && - sha1=$(git rev-parse --revs-only HEAD:sub1) && - if test -n "$sha1" && - test $(cd "../submodule_update_sub1" && git rev-parse --verify "$sha1^{commit}") + hash=$(git rev-parse --revs-only HEAD:sub1) && + if test -n "$hash" && + test $(cd "../submodule_update_sub1" && git rev-parse --verify "$hash^{commit}") then git submodule update --init --recursive "sub1" fi
--
2.12.0.rc1.52.ge239d7e709.dirty