summaryrefslogtreecommitdiff
path: root/fast-import.c
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2019-02-19 00:05:06 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-04-01 02:57:38 (GMT)
commitef479a12bd9e2891c7a1262d95f7d540f79e4a81 (patch)
tree7190013c013a3aa157bdd6ae7e680dd1966a6ae8 /fast-import.c
parent28d055bde9436dc1180d58aec2406579ab6d6307 (diff)
downloadgit-ef479a12bd9e2891c7a1262d95f7d540f79e4a81.zip
git-ef479a12bd9e2891c7a1262d95f7d540f79e4a81.tar.gz
git-ef479a12bd9e2891c7a1262d95f7d540f79e4a81.tar.bz2
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>
Diffstat (limited to 'fast-import.c')
-rw-r--r--fast-import.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fast-import.c b/fast-import.c
index 464db71..35ba262 100644
--- a/fast-import.c
+++ b/fast-import.c
@@ -2955,7 +2955,7 @@ static struct object_entry *parse_treeish_dataref(const char **p)
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;
@@ -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 */
strbuf_reset(&line);
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);
strbuf_addch(&line, '\n');
}