upleb.uk

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

summaryrefslogtreecommitdiff
path: root/src/sub_commands
diff options
context:
space:
mode:
Diffstat (limited to 'src/sub_commands')
-rw-r--r--src/sub_commands/send.rs8
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 }