lib-submodule-update.sh: replace sha1 by hash

Cleaning up code by generalising it. Currently the mailing list discusses yet again how to migrate away from sha1. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Stefan Beller committed Mar 14, 2017 at 14:46 UTC 03c7e2a321f11ba75774a5ef5a3e75b2595e150b
1 file changed +3 -3
t/lib-submodule-update.sh
+3 -3
@@ -171,9 +171,9 @@ reset_work_tree_to () {
171 git checkout -f "$1" &&
172 git status -u -s >actual &&
173 test_must_be_empty actual &&
174 - sha1=$(git rev-parse --revs-only HEAD:sub1) &&
175 - if test -n "$sha1" &&
176 - test $(cd "../submodule_update_sub1" && git rev-parse --verify "$sha1^{commit}")
174 + hash=$(git rev-parse --revs-only HEAD:sub1) &&
175 + if test -n "$hash" &&
176 + test $(cd "../submodule_update_sub1" && git rev-parse --verify "$hash^{commit}")
177 then
178 git submodule update --init --recursive "sub1"
179 fi