sequencer: use the_hash_algo for empty tree object ID
authorbrian m. carlson <sandals@crustytoothpaste.net>
Wed, 2 May 2018 00:26:05 +0000 (00:26 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 2 May 2018 04:59:53 +0000 (13:59 +0900)
To ensure that we are hash algorithm agnostic, use the_hash_algo to look
up the object ID for the empty tree instead of using the empty_tree_oid
variable.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sequencer.c
index 1ccc7782596a5aaceb033c19f6f3db8dd06dff40..94b6513402476fdcf518adeb50f4c3bf4b509913 100644 (file)
@@ -1119,7 +1119,7 @@ static int try_to_commit(struct strbuf *msg, const char *author,
 
        if (!(flags & ALLOW_EMPTY) && !oidcmp(current_head ?
                                              &current_head->tree->object.oid :
-                                             &empty_tree_oid, &tree)) {
+                                             the_hash_algo->empty_tree, &tree)) {
                res = 1; /* run 'git commit' to display error message */
                goto out;
        }