From b103c4bd23b903c83f11370238a481acb1268b7d Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Mon, 4 Mar 2024 11:24:42 +0000 Subject: fix(send): feature branch default to ahead of main instead of the latest commit. issue intrroduced in: 445eea13d987b345535fd4fa56486ff334bbd351 --- src/sub_commands/send.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/sub_commands/send.rs b/src/sub_commands/send.rs index 2a6c220..8d07958 100644 --- a/src/sub_commands/send.rs +++ b/src/sub_commands/send.rs @@ -50,10 +50,11 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs) -> Result<()> { if args.since_or_revision_range.is_empty() || args.since_or_revision_range.eq("master..HEAD") { - let (branch_name, tip) = git_repo.get_main_or_master_branch()?; - if branch_name.eq("main") || branch_name.eq("master") { + let branch_name = git_repo.get_checked_out_branch_name()?; + let (main_branch_name, main_tip) = git_repo.get_main_or_master_branch()?; + if branch_name.eq(main_branch_name) { println!("creating 1 patch from latest commit"); - vec![tip] + vec![main_tip] } else { let (from_branch, to_branch, ahead, behind) = identify_ahead_behind(&git_repo, &None, &None)?; -- cgit v1.2.3