From d7765ff6aab38fd8a665f09b93b709c298caa987 Mon Sep 17 00:00:00 2001 From: Romain Calascibetta Date: Fri, 28 Oct 2022 10:59:27 +0200 Subject: [PATCH] Shallow only when we push --- src/git_kv.ml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/git_kv.ml b/src/git_kv.ml index 89ba555..eead4a8 100644 --- a/src/git_kv.ml +++ b/src/git_kv.ml @@ -510,8 +510,8 @@ module Make (Pclock : Mirage_clock.PCLOCK) = struct Sync.push ~capabilities ~ctx:t.ctx t.edn t.store [ `Update (t.branch, t.branch) ] >|= Result.map_error (fun err -> `Msg (Fmt.str "error pushing branch %a: %a" Git.Reference.pp t.branch Sync.pp_error err)) + >>= Store.shallow t.store hash >|= Result.ok else Lwt.return_ok ()) >>= fun () -> - Lwt.Infix.(Store.shallow t.store hash >|= Result.ok) >>= fun () -> t.head <- Some hash ; Lwt.return_ok () let to_write_error (error : Store.error) = match error with @@ -560,8 +560,8 @@ module Make (Pclock : Mirage_clock.PCLOCK) = struct Sync.push ~capabilities ~ctx:t.ctx t.edn t.store [ `Update (t.branch, t.branch) ] >|= Result.map_error (fun err -> `Msg (Fmt.str "error pushing branch %a: %a" Git.Reference.pp t.branch Sync.pp_error err)) + >>= Store.shallow t.store hash >|= Result.ok else Lwt.return_ok ()) >>= fun () -> - Lwt.Infix.(Store.shallow t.store hash >|= Result.ok) >>= fun () -> t.head <- Some hash ; Lwt.return_ok () | name :: pred_name :: rest, Some head -> let open Lwt.Infix in @@ -583,8 +583,8 @@ module Make (Pclock : Mirage_clock.PCLOCK) = struct Sync.push ~capabilities ~ctx:t.ctx t.edn t.store [ `Update (t.branch, t.branch) ] >|= Result.map_error (fun err -> `Msg (Fmt.str "error pushing branch %a: %a" Git.Reference.pp t.branch Sync.pp_error err)) + >>= Store.shallow t.store hash >|= Result.ok else Lwt.return_ok ()) >>= fun () -> - Lwt.Infix.(Store.shallow t.store hash >|= Result.ok) >>= fun () -> t.head <- Some hash ; Lwt.return_ok () | _ -> Lwt.return_ok ()