Skip to content

Commit

Permalink
fix(stack): show upstream and push of current branch as requested
Browse files Browse the repository at this point in the history
  • Loading branch information
ErichDonGubler committed Jun 8, 2023
1 parent 9bcb9e0 commit 4e28a23
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,17 +127,13 @@ fn main() {
default
});

let mut branches = branches(&config, &|cmd| cmd.arg(base))?;
branches.push("HEAD".to_owned());
if current_branch()?.is_some() {
if config.select_upstreams {
// FIXME: local branch with no upstream still fails. :frown:
branches.push("HEAD@{u}".to_owned());
} else if config.select_pushes {
branches.push("HEAD@{push}".to_owned());
}
if let Some(current_branch) = current_branch()? {
branches(&config, &|cmd| cmd.arg(base).arg(&current_branch))?
} else {
let mut branches = branches(&config, &|cmd| cmd.arg(base))?;
branches.push("HEAD".to_owned());
branches
}
branches
}
Subcommand::Locals { config } => branches(&config, &|cmd| cmd)?,
Subcommand::Select { branches } => branches,
Expand Down

0 comments on commit 4e28a23

Please sign in to comment.