diff options
| author | Edward Thomson <ethomson@edwardthomson.com> | 2023-04-24 12:15:11 +0100 |
|---|---|---|
| committer | Edward Thomson <ethomson@edwardthomson.com> | 2023-05-08 15:06:41 +0100 |
| commit | 6a02b459ab1d9ca6eaeda96cce94ba5ce6f8eaea (patch) | |
| tree | bb931cbce34059fb7418012814a12b777bf955b3 /src/libgit2/grafts.c | |
| parent | 8f7fc2ee505a0abe2186270a79b287e321c748c4 (diff) | |
| download | libgit2-6a02b459ab1d9ca6eaeda96cce94ba5ce6f8eaea.tar.gz | |
futils: use SHA256 for checksums always
Use SHA256 for file checksums. SHA1 makes no sense as a default in 2023.
Given that we're just looking at a file checksum to see if it's changed,
this does not need to take repository's OID type into account or
otherwise be configurable.
Diffstat (limited to 'src/libgit2/grafts.c')
| -rw-r--r-- | src/libgit2/grafts.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libgit2/grafts.c b/src/libgit2/grafts.c index 1bfdc500e..ef314550d 100644 --- a/src/libgit2/grafts.c +++ b/src/libgit2/grafts.c @@ -18,7 +18,7 @@ struct git_grafts { /* File backing the graft. NULL if it's an in-memory graft */ char *path; - git_oid path_checksum; + unsigned char path_checksum[GIT_HASH_SHA256_SIZE]; }; int git_grafts_new(git_grafts **out) @@ -97,7 +97,8 @@ int git_grafts_refresh(git_grafts *grafts) return 0; if ((error = git_futils_readbuffer_updated(&contents, grafts->path, - (grafts->path_checksum).id, &updated)) < 0) { + grafts->path_checksum, &updated)) < 0) { + if (error == GIT_ENOTFOUND) { git_grafts_clear(grafts); error = 0; |
