diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2024-02-23 12:25:11 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2024-02-23 12:25:11 +0000 |
| commit | a9e4c6772a378fd28edbca9b9267d2e7d08bee2c (patch) | |
| tree | 2362ef64da099c87c75e6dde3b0425b2aa0d190c /src/sub_commands/send.rs | |
| parent | 991da4d8dc2bbdd9832dd9252ebebc27d612154c (diff) | |
fix(push): remove force push bug
introduced in b931b37e26486e4e6d15f302e87141dcf2f596ba
Diffstat (limited to 'src/sub_commands/send.rs')
| -rw-r--r-- | src/sub_commands/send.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/sub_commands/send.rs b/src/sub_commands/send.rs index 588e7d1..b5ab78f 100644 --- a/src/sub_commands/send.rs +++ b/src/sub_commands/send.rs | |||
| @@ -47,7 +47,9 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs) -> Result<()> { | |||
| 47 | let git_repo = Repo::discover().context("cannot find a git repository")?; | 47 | let git_repo = Repo::discover().context("cannot find a git repository")?; |
| 48 | 48 | ||
| 49 | let mut commits: Vec<Sha1Hash> = { | 49 | let mut commits: Vec<Sha1Hash> = { |
| 50 | if args.since_or_revision_range.eq("master..HEAD") { | 50 | if args.since_or_revision_range.is_empty() |
| 51 | || args.since_or_revision_range.eq("master..HEAD") | ||
| 52 | { | ||
| 51 | let (from_branch, to_branch, ahead, behind) = | 53 | let (from_branch, to_branch, ahead, behind) = |
| 52 | identify_ahead_behind(&git_repo, &None, &None)?; | 54 | identify_ahead_behind(&git_repo, &None, &None)?; |
| 53 | 55 | ||
| @@ -794,7 +796,7 @@ fn identify_ahead_behind( | |||
| 794 | None => { | 796 | None => { |
| 795 | let (name, commit) = git_repo | 797 | let (name, commit) = git_repo |
| 796 | .get_main_or_master_branch() | 798 | .get_main_or_master_branch() |
| 797 | .context("a destination branch (to_branch) is not specified and the defaults (main or master) do not exist")?; | 799 | .context("the default branches (main or master) do not exist")?; |
| 798 | (name.to_string(), commit) | 800 | (name.to_string(), commit) |
| 799 | } | 801 | } |
| 800 | }; | 802 | }; |
| @@ -867,7 +869,7 @@ mod tests { | |||
| 867 | identify_ahead_behind(&git_repo, &None, &None) | 869 | identify_ahead_behind(&git_repo, &None, &None) |
| 868 | .unwrap_err() | 870 | .unwrap_err() |
| 869 | .to_string(), | 871 | .to_string(), |
| 870 | "a destination branch (to_branch) is not specified and the defaults (main or master) do not exist", | 872 | "the default branches (main or master) do not exist", |
| 871 | ); | 873 | ); |
| 872 | Ok(()) | 874 | Ok(()) |
| 873 | } | 875 | } |