diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2024-03-04 11:24:42 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2024-03-04 11:24:42 +0000 |
| commit | b103c4bd23b903c83f11370238a481acb1268b7d (patch) | |
| tree | bca14be90eccabe24a4ca62c535bed1f5b741f9d | |
| parent | b02b4754c027bd751825c8e3b96766a5898187b1 (diff) | |
fix(send): feature branch default to ahead of main
instead of the latest commit. issue intrroduced in:
445eea13d987b345535fd4fa56486ff334bbd351
| -rw-r--r-- | src/sub_commands/send.rs | 7 |
1 files changed, 4 insertions, 3 deletions
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<()> { | |||
| 50 | if args.since_or_revision_range.is_empty() | 50 | if args.since_or_revision_range.is_empty() |
| 51 | || args.since_or_revision_range.eq("master..HEAD") | 51 | || args.since_or_revision_range.eq("master..HEAD") |
| 52 | { | 52 | { |
| 53 | let (branch_name, tip) = git_repo.get_main_or_master_branch()?; | 53 | let branch_name = git_repo.get_checked_out_branch_name()?; |
| 54 | if branch_name.eq("main") || branch_name.eq("master") { | 54 | let (main_branch_name, main_tip) = git_repo.get_main_or_master_branch()?; |
| 55 | if branch_name.eq(main_branch_name) { | ||
| 55 | println!("creating 1 patch from latest commit"); | 56 | println!("creating 1 patch from latest commit"); |
| 56 | vec![tip] | 57 | vec![main_tip] |
| 57 | } else { | 58 | } else { |
| 58 | let (from_branch, to_branch, ahead, behind) = | 59 | let (from_branch, to_branch, ahead, behind) = |
| 59 | identify_ahead_behind(&git_repo, &None, &None)?; | 60 | identify_ahead_behind(&git_repo, &None, &None)?; |