Skip to content

Commit 41b0706

Browse files
committed
cli: remove error message for invalid remote names
Existing message suggests using `jj git remote rename`, but that's not applicable to `jj git clone`. This commit removes that message.
1 parent 00bc69b commit 41b0706

File tree

3 files changed

+1
-18
lines changed

3 files changed

+1
-18
lines changed

cli/src/command_error.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -585,16 +585,7 @@ jj currently does not support partial clones. To use jj with this repository, tr
585585

586586
impl From<GitRemoteManagementError> for CommandError {
587587
fn from(err: GitRemoteManagementError) -> Self {
588-
match err {
589-
GitRemoteManagementError::NoSuchRemote(_) => user_error(err),
590-
GitRemoteManagementError::RemoteAlreadyExists(_) => user_error(err),
591-
GitRemoteManagementError::RemoteReservedForLocalGitRepo
592-
| GitRemoteManagementError::RemoteWithSlash(_) => user_error_with_hint(
593-
err,
594-
"Run `jj git remote rename` to give a different name.",
595-
),
596-
GitRemoteManagementError::InternalGitError(err) => map_git2_error(err),
597-
}
588+
user_error(err)
598589
}
599590
}
600591

cli/tests/test_git_clone.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,6 @@ fn test_git_clone_with_remote_named_git(subprocess: bool) {
809809
insta::allow_duplicates! {
810810
insta::assert_snapshot!(stderr, @r"
811811
Error: Git remote named 'git' is reserved for local Git repository
812-
Hint: Run `jj git remote rename` to give a different name.
813812
[EOF]
814813
");
815814
}
@@ -832,7 +831,6 @@ fn test_git_clone_with_remote_with_slashes(subprocess: bool) {
832831
insta::allow_duplicates! {
833832
insta::assert_snapshot!(stderr, @r"
834833
Error: Git remotes with slashes are incompatible with jj: slash/origin
835-
Hint: Run `jj git remote rename` to give a different name.
836834
[EOF]
837835
");
838836
}

cli/tests/test_git_remotes.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ fn test_git_remote_add() {
8989
);
9090
insta::assert_snapshot!(stderr, @r"
9191
Error: Git remote named 'git' is reserved for local Git repository
92-
Hint: Run `jj git remote rename` to give a different name.
9392
[EOF]
9493
");
9594
let stdout = test_env.jj_cmd_success(&repo_path, &["git", "remote", "list"]);
@@ -135,7 +134,6 @@ fn test_git_remote_set_url() {
135134
);
136135
insta::assert_snapshot!(stderr, @r"
137136
Error: Git remote named 'git' is reserved for local Git repository
138-
Hint: Run `jj git remote rename` to give a different name.
139137
[EOF]
140138
");
141139
let (stdout, stderr) = test_env.jj_cmd_ok(
@@ -214,7 +212,6 @@ fn test_git_remote_rename() {
214212
let stderr = test_env.jj_cmd_failure(&repo_path, &["git", "remote", "rename", "foo", "git"]);
215213
insta::assert_snapshot!(stderr, @r"
216214
Error: Git remote named 'git' is reserved for local Git repository
217-
Hint: Run `jj git remote rename` to give a different name.
218215
[EOF]
219216
");
220217
let (stdout, stderr) =
@@ -265,7 +262,6 @@ fn test_git_remote_named_git() {
265262
let stderr = test_env.jj_cmd_failure(&repo_path, &["git", "remote", "rename", "bar", "git"]);
266263
insta::assert_snapshot!(stderr, @r"
267264
Error: Git remote named 'git' is reserved for local Git repository
268-
Hint: Run `jj git remote rename` to give a different name.
269265
[EOF]
270266
");
271267

@@ -317,7 +313,6 @@ fn test_git_remote_with_slashes() {
317313
);
318314
insta::assert_snapshot!(stderr, @r"
319315
Error: Git remotes with slashes are incompatible with jj: another/origin
320-
Hint: Run `jj git remote rename` to give a different name.
321316
[EOF]
322317
");
323318
let stdout = test_env.jj_cmd_success(&repo_path, &["git", "remote", "list"]);
@@ -346,7 +341,6 @@ fn test_git_remote_with_slashes() {
346341
);
347342
insta::assert_snapshot!(stderr, @r"
348343
Error: Git remotes with slashes are incompatible with jj: slash/origin
349-
Hint: Run `jj git remote rename` to give a different name.
350344
[EOF]
351345
");
352346

0 commit comments

Comments
 (0)