mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-19 19:08:08 +00:00
cli: inline labeling of trackable remote branches hints
This makes it clear that these hints are printed only if status output is enabled.
This commit is contained in:
parent
b9e29b009d
commit
1ab0c91e51
1 changed files with 3 additions and 7 deletions
|
@ -1993,21 +1993,17 @@ pub fn print_trackable_remote_branches(ui: &Ui, view: &View) -> io::Result<()> {
|
|||
return Ok(());
|
||||
}
|
||||
|
||||
if let Some(mut writer) = ui.hint_default() {
|
||||
if let Some(mut formatter) = ui.status_formatter() {
|
||||
writeln!(
|
||||
writer,
|
||||
formatter.labeled("hint").with_heading("Hint: "),
|
||||
"The following remote branches aren't associated with the existing local branches:"
|
||||
)?;
|
||||
}
|
||||
if let Some(mut formatter) = ui.status_formatter() {
|
||||
for full_name in &remote_branch_names {
|
||||
write!(formatter, " ")?;
|
||||
writeln!(formatter.labeled("branch"), "{full_name}")?;
|
||||
}
|
||||
}
|
||||
if let Some(mut writer) = ui.hint_default() {
|
||||
writeln!(
|
||||
writer,
|
||||
formatter.labeled("hint").with_heading("Hint: "),
|
||||
"Run `jj branch track {names}` to keep local branches updated on future pulls.",
|
||||
names = remote_branch_names.join(" "),
|
||||
)?;
|
||||
|
|
Loading…
Reference in a new issue