Skip to content

Commit 3f34d70

Browse files
bk2204gitster
authored andcommitted
rerere: 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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent fc06be3 commit 3f34d70

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

rerere.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ static void free_rerere_id(struct string_list_item *item)
5252

5353
static const char *rerere_id_hex(const struct rerere_id *id)
5454
{
55-
return sha1_to_hex(id->collection->hash);
55+
return hash_to_hex(id->collection->hash);
5656
}
5757

5858
static void fit_variant(struct rerere_dir *rr_dir, int variant)
@@ -115,7 +115,7 @@ static int is_rr_file(const char *name, const char *filename, int *variant)
115115
static void scan_rerere_dir(struct rerere_dir *rr_dir)
116116
{
117117
struct dirent *de;
118-
DIR *dir = opendir(git_path("rr-cache/%s", sha1_to_hex(rr_dir->hash)));
118+
DIR *dir = opendir(git_path("rr-cache/%s", hash_to_hex(rr_dir->hash)));
119119

120120
if (!dir)
121121
return;
@@ -186,9 +186,9 @@ static struct rerere_id *new_rerere_id_hex(char *hex)
186186
return id;
187187
}
188188

189-
static struct rerere_id *new_rerere_id(unsigned char *sha1)
189+
static struct rerere_id *new_rerere_id(unsigned char *hash)
190190
{
191-
return new_rerere_id_hex(sha1_to_hex(sha1));
191+
return new_rerere_id_hex(hash_to_hex(hash));
192192
}
193193

194194
/*

0 commit comments

Comments
 (0)