Commit c3866fa87cf6df0d0491ea16303515bebdf56de6

Edward Thomson 2019-01-20T18:54:16

diff: explicitly cast in flush_hunk Quiet down a warning from MSVC about how we're potentially losing data.

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/diff.c b/src/diff.c
index 5abb4d1..d2e129d 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -386,7 +386,7 @@ static int flush_hunk(git_oid *result, git_hash_ctx *ctx)
 
 	for (i = 0; i < GIT_OID_RAWSZ; i++) {
 		carry += result->id[i] + hash.id[i];
-		result->id[i] = carry;
+		result->id[i] = (unsigned char)carry;
 		carry >>= 8;
 	}