The git branch the push will land on: the resolved `override_branch` (explicit `--branch` or a draft view's mapped branch) if present, else the currently checked-out branch.
(&self, git_repo: &GitRepository, override_branch: Option<&str>)
| 666 | /// (explicit `--branch` or a draft view's mapped branch) if present, else |
| 667 | /// the currently checked-out branch. |
| 668 | fn target_branch(&self, git_repo: &GitRepository, override_branch: Option<&str>) -> String { |
| 669 | if let Some(branch) = override_branch { |
| 670 | return branch.to_string(); |
| 671 | } |
| 672 | git_repo |
| 673 | .head() |
| 674 | .ok() |
| 675 | .and_then(|h| h.shorthand().ok().map(str::to_owned)) |
| 676 | .unwrap_or_else(|| "HEAD".to_string()) |
| 677 | } |
| 678 | |
| 679 | /// Count commits on `branch_name` that haven't been pushed to the push |
| 680 | /// target. The comparison point is the branch's configured upstream, |