fast-import: replace sha1_to_hex
Replace the uses of sha1_to_hex in this function with hash_to_hex to allow the use of SHA-256 as well. Rename a variable since it is no longer limited to SHA-1. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
brian m. carlson committed
Feb 19, 2019 at 00:05 UTC
ef479a12bd9e2891c7a1262d95f7d540f79e4a81
1 file changed
+2
-2
fast-import.c
+2
-2
@@ -2955,7 +2955,7 @@ static struct object_entry *parse_treeish_dataref(const char **p)
2955
return e;
2956
}
2957
2958
-static void print_ls(int mode, const unsigned char *sha1, const char *path)
2958
+static void print_ls(int mode, const unsigned char *hash, const char *path)
2959
{
2960
static struct strbuf line = STRBUF_INIT;
2961
@@ -2975,7 +2975,7 @@ static void print_ls(int mode, const unsigned char *sha1, const char *path)
2975
/* mode SP type SP object_name TAB path LF */
2976
strbuf_reset(&line);
2977
strbuf_addf(&line, "%06o %s %s\t",
2978
- mode & ~NO_DELTA, type, sha1_to_hex(sha1));
2978
+ mode & ~NO_DELTA, type, hash_to_hex(hash));
2979
quote_c_style(path, &line, NULL, 0);
2980
strbuf_addch(&line, '\n');
2981
}