upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/sub_commands/claim.rs
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2024-02-09 07:21:00 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2024-02-09 07:21:00 +0000
commit9cd3e43b899b23b7f6e75276fa3d19bf9550f8fd (patch)
treef88539e7988e13a7fdd9736a6a672048ee00e59a /src/sub_commands/claim.rs
parent4b0a35583644e703eb615e0724d33fe93aec932b (diff)
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
Diffstat (limited to 'src/sub_commands/claim.rs')
-rw-r--r--src/sub_commands/claim.rs6
1 files changed, 1 insertions, 5 deletions
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 {
33pub async fn launch(cli_args: &Cli, args: &SubCommandArgs) -> Result<()> { 33pub async fn launch(cli_args: &Cli, args: &SubCommandArgs) -> Result<()> {
34 let git_repo = Repo::discover().context("cannot find a git repository")?; 34 let git_repo = Repo::discover().context("cannot find a git repository")?;
35 35
36 let (main_or_master_branch_name, _) = git_repo
37 .get_main_or_master_branch()
38 .context("no main or master branch")?;
39
40 let root_commit = git_repo 36 let root_commit = git_repo
41 .get_root_commit(main_or_master_branch_name) 37 .get_root_commit()
42 .context("failed to get root commit of the repository")?; 38 .context("failed to get root commit of the repository")?;
43 39
44 // TODO: check for empty repo 40 // TODO: check for empty repo