diff --git a/cli/src/commands/branch.rs b/cli/src/commands/branch.rs index 98de4595a..eccd37ba6 100644 --- a/cli/src/commands/branch.rs +++ b/cli/src/commands/branch.rs @@ -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(()) } diff --git a/cli/tests/test_branch_command.rs b/cli/tests/test_branch_command.rs index dcac38d15..3baa64b9c 100644 --- a/cli/tests/test_branch_command.rs +++ b/cli/tests/test_branch_command.rs @@ -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