ok/jj
1
0
Fork 0
forked from mirrors/jj

cleanup: fix bad formatting of commands.rs

This commit is contained in:
Martin von Zweigbergk 2021-08-11 10:56:04 -07:00
parent 42090c8078
commit aba0d200e2

View file

@ -2114,7 +2114,8 @@ fn cmd_branches(
let repo_command = command.repo_helper(ui)?;
let repo = repo_command.repo();
let print_branch_target = |ui: &mut Ui, target: Option<&RefTarget>| -> Result<(), CommandError> {
let print_branch_target =
|ui: &mut Ui, target: Option<&RefTarget>| -> Result<(), CommandError> {
match target {
Some(RefTarget::Normal(id)) => {
write!(ui, ": ")?;
@ -2154,7 +2155,11 @@ fn cmd_branches(
ui.stdout_formatter().remove_label()?;
print_branch_target(ui, branch_target.local_target.as_ref())?;
for (remote, remote_target) in branch_target.remote_targets.iter().sorted_by_key(|(name, _target)| name.to_owned()) {
for (remote, remote_target) in branch_target
.remote_targets
.iter()
.sorted_by_key(|(name, _target)| name.to_owned())
{
if Some(remote_target) == branch_target.local_target.as_ref() {
continue;
}
@ -2162,10 +2167,10 @@ fn cmd_branches(
write!(ui, "{}@{}", name, remote)?;
ui.stdout_formatter().remove_label()?;
print_branch_target(ui, Some(remote_target))?;
// TODO: Display information about remote branches, but probably only
// those that have different targets than the local branch.
// Maybe indicate how much the remotes are ahead/behind/
// diverged.
// TODO: Display information about remote branches, but probably
// only those that have different targets than the local
// branch. Maybe indicate how much the remotes are
// ahead/behind/ diverged.
}
}