From ce3cdd0039be0cf0543ac0937b5d6c06bb69891b Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Thu, 22 Feb 2024 15:04:08 +0000 Subject: fix(list): local rebase detected as ammendments also updated copy and code comments --- src/sub_commands/list.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/sub_commands') diff --git a/src/sub_commands/list.rs b/src/sub_commands/list.rs index c6af397..a815cc3 100644 --- a/src/sub_commands/list.rs +++ b/src/sub_commands/list.rs @@ -436,12 +436,13 @@ pub async fn launch(_cli_args: &Cli, _args: &SubCommandArgs) -> Result<()> { } }; } - // tip of proposal in branch in history (local appendments made to up-to-date // proposal) - if let Ok((local_ahead_of_proposal, _)) = - git_repo.get_commits_ahead_behind(&proposal_tip, &local_branch_tip) - { + else if git_repo.ancestor_of(&local_branch_tip, &proposal_tip)? { + let (local_ahead_of_proposal, _) = git_repo + .get_commits_ahead_behind(&proposal_tip, &local_branch_tip) + .context("cannot get commits ahead behind for propsal_top and local_branch_tip")?; + println!( "local proposal branch exists with {} unpublished commits on top of the most up-to-date version of the proposal ({} ahead {} behind '{main_branch_name}')", local_ahead_of_proposal.len(), -- cgit v1.2.3