Skip to content

Commit

Permalink
[#10] Use pure function instead of calling 'basename' (#34)
Browse files Browse the repository at this point in the history
* Used Core.Filename.basename to find base name
* Add to contributors
  • Loading branch information
LeedsJohn authored Dec 30, 2023
1 parent 3e51741 commit 6d9d485
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ available [on GitHub][2].
- [#31](https://github.com/chshersh/zbg/pull/31):
Command `zbg push -f` now uses git's `--force-with-lease` because it's a safer default
(by [@kephas])
-[#10](https://github.com/chshersh/zbg/issues/10):
Changed `fetch_main_branch` to get the base name using `Core.Filename.basename` rather than reading the output of the `basename` command.
(by [@leedsjohn])

## [0.2.0] — 2023-12-17 🎄

Expand Down Expand Up @@ -51,6 +54,7 @@ Initial release prepared by [@chshersh].
<!-- Contributors -->

[@chshersh]: https://github.com/chshersh
[@leedsjohn]: https://github.com/leedsjohn
[@paulpatault]: https://github.com/paulpatault
[@sloboegen]: https://github.com/sloboegen
[@tekknoid]: https://github.com/tekknoid
Expand Down
3 changes: 1 addition & 2 deletions lib/git.ml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ 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 *)
Core.Filename.basename remote_main_branch

let branch_or_main (branch_opt : string option) : string =
match branch_opt with
Expand Down

0 comments on commit 6d9d485

Please sign in to comment.