mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-18 18:27:38 +00:00
cli: hint about how to recover from failed export of branches
This commit is contained in:
parent
e6d21ed442
commit
2e725270e4
3 changed files with 13 additions and 0 deletions
|
@ -907,6 +907,13 @@ pub fn print_failed_git_export(
|
||||||
formatter.with_label("branch", |formatter| formatter.write_str(branch_name))?;
|
formatter.with_label("branch", |formatter| formatter.write_str(branch_name))?;
|
||||||
formatter.write_str("\n")?;
|
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(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
@ -193,6 +193,9 @@ fn test_git_colocated_conflicting_git_refs() {
|
||||||
insta::assert_snapshot!(get_stderr_string(&assert), @r###"
|
insta::assert_snapshot!(get_stderr_string(&assert), @r###"
|
||||||
Failed to export some branches:
|
Failed to export some branches:
|
||||||
main/sub
|
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.
|
||||||
"###);
|
"###);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,5 +32,8 @@ fn test_git_export_conflicting_git_refs() {
|
||||||
insta::assert_snapshot!(get_stderr_string(&assert), @r###"
|
insta::assert_snapshot!(get_stderr_string(&assert), @r###"
|
||||||
Failed to export some branches:
|
Failed to export some branches:
|
||||||
main/sub
|
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.
|
||||||
"###);
|
"###);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue