mirror of
https://github.com/chshersh/zbg.git
synced 2024-10-04 04:17:18 +03:00
Specify type signatures for some local functions
This commit is contained in:
parent
742b0810ba
commit
23075d6397
@ -2,10 +2,10 @@ open Core
|
||||
|
||||
(* Custom types *)
|
||||
|
||||
let to_force_flag (flag : bool) =
|
||||
let to_force_flag (flag : bool) : Git.force_flag =
|
||||
if flag then Git.Force else Git.NoForce
|
||||
|
||||
let to_tag_action (is_delete : bool) =
|
||||
let to_tag_action (is_delete : bool) : Git.tag_action =
|
||||
if is_delete then Git.Delete else Git.Create
|
||||
|
||||
(* Commands *)
|
||||
|
@ -1,13 +1,13 @@
|
||||
(* INTERNALS *)
|
||||
|
||||
let get_current_branch () =
|
||||
let get_current_branch () : string =
|
||||
Process.proc_stdout "git rev-parse --abbrev-ref HEAD"
|
||||
|
||||
let fetch_main_branch () =
|
||||
let fetch_main_branch () : string =
|
||||
let remote_main_branch = Process.proc_stdout "git rev-parse --abbrev-ref origin/HEAD" in
|
||||
Process.proc_stdout (Printf.sprintf "basename %s" remote_main_branch) (* TODO: use pure function *)
|
||||
|
||||
let branch_or_main branch_opt =
|
||||
let branch_or_main (branch_opt : string option) : string =
|
||||
match branch_opt with
|
||||
| Some branch -> branch
|
||||
| None -> fetch_main_branch ()
|
||||
|
@ -3,7 +3,7 @@ let proc cmd =
|
||||
let _exit_code = Unix.system cmd in
|
||||
()
|
||||
|
||||
let collect_chan (channel : in_channel) =
|
||||
let collect_chan (channel : in_channel) : string =
|
||||
let rec loop acc =
|
||||
match input_line channel with
|
||||
| exception End_of_file -> acc
|
||||
|
Loading…
Reference in New Issue
Block a user