Skip to content

Commit

Permalink
Git_mirage should not depend on Unix ...
Browse files Browse the repository at this point in the history
  • Loading branch information
samoht committed Jul 14, 2015
1 parent 4110184 commit 68dc8f9
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions lib/mirage/git_mirage.ml
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,12 @@ module Git_protocol = struct
Lwt.catch
(fun () -> Channel.close c)
(function
| End_of_file | Unix.Unix_error _ -> Lwt.return_unit
| e -> Lwt.fail e)
| End_of_file -> Lwt.return_unit
| e ->
(* WARNING: do not catch `Unix` exception here, as it will
bring a unwanted dependency to unix.cma *)
Log.debug "Ignoring exn: %s" (Printexc.to_string e);
Lwt.return_unit)

let with_connection (resolver, conduit) uri ?init fn =
assert (Git.Sync.protocol uri = `Ok `Git);
Expand Down Expand Up @@ -331,8 +335,12 @@ module Smart_HTTP = struct
Lwt.catch
(fun () -> Conduit_channel.close ic)
(function
| End_of_file | Unix.Unix_error _ -> Lwt.return_unit
| e -> Lwt.fail e)
| End_of_file -> Lwt.return_unit
| e ->
(* WARNING: do not catch `Unix` exception here, as it will
bring a unwanted dependency to unix.cma *)
Log.debug "Ignoring exn: %s" (Printexc.to_string e);
Lwt.return_unit)

module HTTP_fn = Git_http.Flow(HTTP)(In_channel)(Out_channel)
let with_conduit ctx ?init uri fn =
Expand Down

0 comments on commit 68dc8f9

Please sign in to comment.