cli: hint about how to recover from failed export of branches

This commit is contained in:
Martin von Zweigbergk 2022-11-28 05:50:36 -08:00 committed by Martin von Zweigbergk
parent e6d21ed442
commit 2e725270e4
3 changed files with 13 additions and 0 deletions

View File

@ -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(())
}

View File

@ -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.
"###);
}

View File

@ -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.
"###);
}