diff --git a/src/cli_util.rs b/src/cli_util.rs index 53af9ce61..fcaf1f663 100644 --- a/src/cli_util.rs +++ b/src/cli_util.rs @@ -907,6 +907,13 @@ pub fn print_failed_git_export( formatter.with_label("branch", |formatter| formatter.write_str(branch_name))?; formatter.write_str("\n")?; } + drop(formatter); + ui.write_hint( + r#"Hint: Git doesn't allow a branch name that looks like a parent directory of +another (e.g. `foo` and `foo/bar`). Try to rename the branches that failed to +export or their "parent" branches. +"#, + )?; } Ok(()) } diff --git a/tests/test_git_colocated.rs b/tests/test_git_colocated.rs index 96e81548b..514f50981 100644 --- a/tests/test_git_colocated.rs +++ b/tests/test_git_colocated.rs @@ -193,6 +193,9 @@ fn test_git_colocated_conflicting_git_refs() { insta::assert_snapshot!(get_stderr_string(&assert), @r###" Failed to export some branches: main/sub + Hint: Git doesn't allow a branch name that looks like a parent directory of + another (e.g. `foo` and `foo/bar`). Try to rename the branches that failed to + export or their "parent" branches. "###); } diff --git a/tests/test_git_export.rs b/tests/test_git_export.rs index 315960798..93d9b5e3b 100644 --- a/tests/test_git_export.rs +++ b/tests/test_git_export.rs @@ -32,5 +32,8 @@ fn test_git_export_conflicting_git_refs() { insta::assert_snapshot!(get_stderr_string(&assert), @r###" Failed to export some branches: main/sub + Hint: Git doesn't allow a branch name that looks like a parent directory of + another (e.g. `foo` and `foo/bar`). Try to rename the branches that failed to + export or their "parent" branches. "###); }