summaryrefslogtreecommitdiff
path: root/rerere.c
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2019-08-18 20:04:25 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-08-19 22:04:59 (GMT)
commit3f34d70d4029c420d0db82fc39e77da4470eb3cc (patch)
treefe49b9bc7e662434a21ed5a208da184455de0ace /rerere.c
parentfc06be3b7f065d197fd484098f517fa9d19c9d2b (diff)
downloadgit-3f34d70d4029c420d0db82fc39e77da4470eb3cc.zip
git-3f34d70d4029c420d0db82fc39e77da4470eb3cc.tar.gz
git-3f34d70d4029c420d0db82fc39e77da4470eb3cc.tar.bz2
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 <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'rerere.c')
-rw-r--r--rerere.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/rerere.c b/rerere.c
index 17abb47..3e51fdf 100644
--- a/rerere.c
+++ b/rerere.c
@@ -52,7 +52,7 @@ static void free_rerere_id(struct string_list_item *item)
static const char *rerere_id_hex(const struct rerere_id *id)
{
- return sha1_to_hex(id->collection->hash);
+ return hash_to_hex(id->collection->hash);
}
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)
static void scan_rerere_dir(struct rerere_dir *rr_dir)
{
struct dirent *de;
- DIR *dir = opendir(git_path("rr-cache/%s", sha1_to_hex(rr_dir->hash)));
+ DIR *dir = opendir(git_path("rr-cache/%s", hash_to_hex(rr_dir->hash)));
if (!dir)
return;
@@ -186,9 +186,9 @@ static struct rerere_id *new_rerere_id_hex(char *hex)
return id;
}
-static struct rerere_id *new_rerere_id(unsigned char *sha1)
+static struct rerere_id *new_rerere_id(unsigned char *hash)
{
- return new_rerere_id_hex(sha1_to_hex(sha1));
+ return new_rerere_id_hex(hash_to_hex(hash));
}
/*