mirror of
https://github.com/git/git
synced 2024-08-28 03:59:25 +00:00
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>
This commit is contained in:
parent
28d055bde9
commit
ef479a12bd
|
@ -2955,7 +2955,7 @@ static struct object_entry *parse_treeish_dataref(const char **p)
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void print_ls(int mode, const unsigned char *sha1, const char *path)
|
static void print_ls(int mode, const unsigned char *hash, const char *path)
|
||||||
{
|
{
|
||||||
static struct strbuf line = STRBUF_INIT;
|
static struct strbuf line = STRBUF_INIT;
|
||||||
|
|
||||||
|
@ -2975,7 +2975,7 @@ static void print_ls(int mode, const unsigned char *sha1, const char *path)
|
||||||
/* mode SP type SP object_name TAB path LF */
|
/* mode SP type SP object_name TAB path LF */
|
||||||
strbuf_reset(&line);
|
strbuf_reset(&line);
|
||||||
strbuf_addf(&line, "%06o %s %s\t",
|
strbuf_addf(&line, "%06o %s %s\t",
|
||||||
mode & ~NO_DELTA, type, sha1_to_hex(sha1));
|
mode & ~NO_DELTA, type, hash_to_hex(hash));
|
||||||
quote_c_style(path, &line, NULL, 0);
|
quote_c_style(path, &line, NULL, 0);
|
||||||
strbuf_addch(&line, '\n');
|
strbuf_addch(&line, '\n');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue