Convert several uses of EMPTY_TREE_SHA1_HEX to use oid_to_hex and the_hash_algo to avoid a dependency on a given hash algorithm. Signed-off-by: brian m. carlson <sandals@xxxxxxxxxxxxxxxxxxxx> --- submodule.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/submodule.c b/submodule.c index 9a50168b23..22a96b7af0 100644 --- a/submodule.c +++ b/submodule.c @@ -1567,7 +1567,7 @@ static void submodule_reset_index(const char *path) get_super_prefix_or_empty(), path); argv_array_pushl(&cp.args, "read-tree", "-u", "--reset", NULL); - argv_array_push(&cp.args, EMPTY_TREE_SHA1_HEX); + argv_array_push(&cp.args, oid_to_hex(the_hash_algo->empty_tree)); if (run_command(&cp)) die("could not reset submodule index"); @@ -1659,9 +1659,9 @@ int submodule_move_head(const char *path, argv_array_push(&cp.args, "-m"); if (!(flags & SUBMODULE_MOVE_HEAD_FORCE)) - argv_array_push(&cp.args, old_head ? old_head : EMPTY_TREE_SHA1_HEX); + argv_array_push(&cp.args, old_head ? old_head : oid_to_hex(the_hash_algo->empty_tree)); - argv_array_push(&cp.args, new_head ? new_head : EMPTY_TREE_SHA1_HEX); + argv_array_push(&cp.args, new_head ? new_head : oid_to_hex(the_hash_algo->empty_tree)); if (run_command(&cp)) { ret = -1;