From f6210aa99dd01c827ee8bc7093475c7a09c5955f Mon Sep 17 00:00:00 2001 From: Nathanael Huffman Date: Mon, 25 Nov 2024 17:51:47 -0600 Subject: [PATCH] cli: Fix error message grammar and associated tests --- cli/src/command_error.rs | 2 +- cli/tests/test_working_copy.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cli/src/command_error.rs b/cli/src/command_error.rs index 48c1672967..67ec8d9e96 100644 --- a/cli/src/command_error.rs +++ b/cli/src/command_error.rs @@ -374,7 +374,7 @@ impl From for CommandError { err_str, )) .hinted(format!( - "This is to prevent large files from being added on accident. You can fix \ + "This is to prevent large files from being added by accident. You can fix \ this error by: - Adding the file to `.gitignore` - Run `jj config set --repo snapshot.max-new-file-size {}` diff --git a/cli/tests/test_working_copy.rs b/cli/tests/test_working_copy.rs index 3efb8a5073..826293b3d2 100644 --- a/cli/tests/test_working_copy.rs +++ b/cli/tests/test_working_copy.rs @@ -30,7 +30,7 @@ fn test_snapshot_large_file() { insta::assert_snapshot!(stderr, @r###" Error: Failed to snapshot the working copy The file '$TEST_ENV/repo/large' is too large to be snapshotted: it is 3 bytes too large; the maximum size allowed is 10 bytes (10.0B). - Hint: This is to prevent large files from being added on accident. You can fix this error by: + Hint: This is to prevent large files from being added by accident. You can fix this error by: - Adding the file to `.gitignore` - Run `jj config set --repo snapshot.max-new-file-size 13` This will increase the maximum file size allowed for new files, in this repository only. @@ -46,7 +46,7 @@ fn test_snapshot_large_file() { insta::assert_snapshot!(stderr, @r###" Error: Failed to snapshot the working copy The file '$TEST_ENV/repo/large' is too large to be snapshotted: it is 1024 bytes too large; the maximum size allowed is 10240 bytes (10.0KiB). - Hint: This is to prevent large files from being added on accident. You can fix this error by: + Hint: This is to prevent large files from being added by accident. You can fix this error by: - Adding the file to `.gitignore` - Run `jj config set --repo snapshot.max-new-file-size 11264` This will increase the maximum file size allowed for new files, in this repository only.