Merge pull request 'Fix bad bytes when we want to emit an empty PACK file' (#18) from empty-pack-file into main

Reviewed-on: https://git.robur.io/robur/git-kv/pulls/18
This commit is contained in:
dinosaure 2022-10-21 14:37:15 +00:00
commit 46dfef5d4a

View file

@ -255,7 +255,7 @@ let pack t ~commit stream =
let to_octets t = match t.head with let to_octets t = match t.head with
| None -> | None ->
Lwt.return "PACK\000\000\000\002\000\000\000\000\ Lwt.return "PACK\000\000\000\002\000\000\000\000\
\x02\x9d\x08\x82\x3b\xd8\xa8\xea\xb5\xad\x6a\xc7\x5c\x82\x3c\xfd\x3e\xd3\x1e" \x02\x9d\x08\x82\x3b\xd8\xa8\xea\xb5\x10\xad\x6a\xc7\x5c\x82\x3c\xfd\x3e\xd3\x1e"
| Some commit -> | Some commit ->
let buf = Buffer.create 0x100 in let buf = Buffer.create 0x100 in
let stream = Option.iter (Buffer.add_string buf) in let stream = Option.iter (Buffer.add_string buf) in