From 9cd3e43b899b23b7f6e75276fa3d19bf9550f8fd Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Fri, 9 Feb 2024 07:21:00 +0000 Subject: refactor(git): find root commit from head this is simpler there is no need to check whether main or master exist because one does 99+% of the time the root commit wil be te same for head as master 99+% of the time --- src/sub_commands/claim.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/sub_commands/claim.rs') diff --git a/src/sub_commands/claim.rs b/src/sub_commands/claim.rs index 05ad961..d3a80c8 100644 --- a/src/sub_commands/claim.rs +++ b/src/sub_commands/claim.rs @@ -33,12 +33,8 @@ pub struct SubCommandArgs { pub async fn launch(cli_args: &Cli, args: &SubCommandArgs) -> Result<()> { let git_repo = Repo::discover().context("cannot find a git repository")?; - let (main_or_master_branch_name, _) = git_repo - .get_main_or_master_branch() - .context("no main or master branch")?; - let root_commit = git_repo - .get_root_commit(main_or_master_branch_name) + .get_root_commit() .context("failed to get root commit of the repository")?; // TODO: check for empty repo -- cgit v1.2.3