mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-15 00:44:33 +00:00
cli: show stats if multiple branches are tracked/untracked
Just like the other branch commands.
This commit is contained in:
parent
d7f504c98c
commit
baef7f1da2
2 changed files with 17 additions and 1 deletions
|
@ -496,6 +496,13 @@ fn cmd_branch_track(
|
|||
.track_remote_branch(&name.branch, &name.remote);
|
||||
}
|
||||
tx.finish(ui)?;
|
||||
if names.len() > 1 {
|
||||
writeln!(
|
||||
ui.stderr(),
|
||||
"Started tracking {} remote branches.",
|
||||
names.len()
|
||||
)?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
@ -527,6 +534,13 @@ fn cmd_branch_untrack(
|
|||
.untrack_remote_branch(&name.branch, &name.remote);
|
||||
}
|
||||
tx.finish(ui)?;
|
||||
if names.len() > 1 {
|
||||
writeln!(
|
||||
ui.stderr(),
|
||||
"Stopped tracking {} remote branches.",
|
||||
names.len()
|
||||
)?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
|
@ -778,7 +778,9 @@ fn test_branch_track_untrack_patterns() {
|
|||
|
||||
// Track by pattern
|
||||
let (_, stderr) = test_env.jj_cmd_ok(&repo_path, &["branch", "track", "glob:feature?@origin"]);
|
||||
insta::assert_snapshot!(stderr, @"");
|
||||
insta::assert_snapshot!(stderr, @r###"
|
||||
Started tracking 2 remote branches.
|
||||
"###);
|
||||
insta::assert_snapshot!(get_branch_output(&test_env, &repo_path), @r###"
|
||||
feature1: omvolwpu 1336caed commit
|
||||
@git: omvolwpu 1336caed commit
|
||||
|
|
Loading…
Reference in a new issue