mirror of
https://github.com/martinvonz/jj.git
synced 2024-12-24 20:54:15 +00:00
cli: use "hint" style for hint about using --git-repo=.
This commit is contained in:
parent
7ce8138794
commit
92f6571b31
2 changed files with 6 additions and 4 deletions
|
@ -1100,9 +1100,10 @@ Set `ui.allow-init-native` to allow initializing a repo with the native backend.
|
|||
let relative_wc_path = file_util::relative_path(&cwd, &wc_path);
|
||||
writeln!(ui, "Initialized repo in \"{}\"", relative_wc_path.display())?;
|
||||
if args.git && wc_path.join(".git").exists() {
|
||||
ui.write_warn(format!(
|
||||
"Empty repo created. To create repo backed by existing Git repo, run `jj init \
|
||||
--git-repo={}` instead.\n",
|
||||
ui.write_warn("Empty repo created.\n")?;
|
||||
ui.write_hint(format!(
|
||||
"Hint: To create a repo backed by the existing Git repo, run `jj init --git-repo={}` \
|
||||
instead.\n",
|
||||
relative_wc_path.display()
|
||||
))?;
|
||||
}
|
||||
|
|
|
@ -169,7 +169,8 @@ fn test_init_git_internal_but_could_be_colocated() {
|
|||
Initialized repo in "."
|
||||
"###);
|
||||
insta::assert_snapshot!(get_stderr_string(&assert), @r###"
|
||||
Empty repo created. To create repo backed by existing Git repo, run `jj init --git-repo=.` instead.
|
||||
Empty repo created.
|
||||
Hint: To create a repo backed by the existing Git repo, run `jj init --git-repo=.` instead.
|
||||
"###);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue