Skip to content

Commit

Permalink
cli: hint about how to recover from failed export of branches
Browse files Browse the repository at this point in the history
  • Loading branch information
martinvonz committed Nov 29, 2022
1 parent e6d21ed commit 2e72527
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/cli_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
}
Expand Down
3 changes: 3 additions & 0 deletions tests/test_git_colocated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"###);
}

Expand Down
3 changes: 3 additions & 0 deletions tests/test_git_export.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"###);
}

0 comments on commit 2e72527

Please sign in to comment.