1
0
mirror of https://github.com/git/git synced 2024-07-05 00:58:49 +00:00
git/compat/sha1-chunked.c
Elijah Newren bc5c5ec044 cache.h: remove this no-longer-used header
Since this header showed up in some places besides just #include
statements, update/clean-up/remove those other places as well.

Note that compat/fsmonitor/fsm-path-utils-darwin.c previously got
away with violating the rule that all files must start with an include
of git-compat-util.h (or a short-list of alternate headers that happen
to include it first).  This change exposed the violation and caused it
to stop building correctly; fix it by having it include
git-compat-util.h first, as per policy.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-06-21 13:39:53 -07:00

21 lines
393 B
C

#include "git-compat-util.h"
#include "hash-ll.h"
int git_SHA1_Update_Chunked(platform_SHA_CTX *c, const void *data, size_t len)
{
size_t nr;
size_t total = 0;
const char *cdata = (const char*)data;
while (len) {
nr = len;
if (nr > SHA1_MAX_BLOCK_SIZE)
nr = SHA1_MAX_BLOCK_SIZE;
platform_SHA1_Update(c, cdata, nr);
total += nr;
cdata += nr;
len -= nr;
}
return total;
}