From 8516dac1e1836843dd6a3dbc1d140a8b6d885ecb Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 9 Mar 2023 22:54:06 +0100 Subject: t0033: GETTEXT_POISON fix In e47363e5a8bd (t0033: add tests for safe.directory, 2022-04-13), we backported a patch onto v2.30.* that was originally based on a much newer version. The v2.30.* release train still has the GETTEXT_POISON CI job, though, and hence needs `test_i18n*` in its tests. Signed-off-by: Johannes Schindelin --- t/t0033-safe-directory.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 't') diff --git a/t/t0033-safe-directory.sh b/t/t0033-safe-directory.sh index 239d93f4d2..00c6c51100 100755 --- a/t/t0033-safe-directory.sh +++ b/t/t0033-safe-directory.sh @@ -9,7 +9,7 @@ export GIT_TEST_ASSUME_DIFFERENT_OWNER expect_rejected_dir () { test_must_fail git status 2>err && - grep "safe.directory" err + test_i18ngrep "safe.directory" err } test_expect_success 'safe.directory is not set' ' -- cgit v1.2.3 From e4298ccd7ff74cd2e11ff952b42c33ccc746e617 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 9 Mar 2023 22:51:43 +0100 Subject: t0003: GETTEXT_POISON fix, part 1 In dfa6b32b5e59 (attr: ignore attribute lines exceeding 2048 bytes, 2022-12-01), we backported a patch onto v2.30.* that was originally based on a much newer version. The v2.30.* release train still has the GETTEXT_POISON CI job, though, and hence needs `test_i18n*` in its tests. Signed-off-by: Johannes Schindelin --- t/t0003-attributes.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 't') diff --git a/t/t0003-attributes.sh b/t/t0003-attributes.sh index 9d9aa2855d..5bd9d9832d 100755 --- a/t/t0003-attributes.sh +++ b/t/t0003-attributes.sh @@ -344,7 +344,7 @@ test_expect_success 'large attributes line ignored in tree' ' printf "path %02043d" 1 >.gitattributes && git check-attr --all path >actual 2>err && echo "warning: ignoring overly long attributes line 1" >expect && - test_cmp expect err && + test_i18ncmp expect err && test_must_be_empty actual ' @@ -357,7 +357,7 @@ test_expect_success 'large attributes line ignores trailing content in tree' ' printf "a %02045dtrailing attribute\n" 1 >.gitattributes && git check-attr --all trailing >actual 2>err && echo "warning: ignoring overly long attributes line 1" >expect && - test_cmp expect err && + test_i18ncmp expect err && test_must_be_empty actual ' @@ -375,7 +375,7 @@ test_expect_success 'large attributes line ignored in index' ' git update-index --add --cacheinfo 100644,$blob,.gitattributes && git check-attr --cached --all path >actual 2>err && echo "warning: ignoring overly long attributes line 1" >expect && - test_cmp expect err && + test_i18ncmp expect err && test_must_be_empty actual ' @@ -385,7 +385,7 @@ test_expect_success 'large attributes line ignores trailing content in index' ' git update-index --add --cacheinfo 100644,$blob,.gitattributes && git check-attr --cached --all trailing >actual 2>err && echo "warning: ignoring overly long attributes line 1" >expect && - test_cmp expect err && + test_i18ncmp expect err && test_must_be_empty actual ' -- cgit v1.2.3 From d99728b2cafb3346679cb8733221c41149fdc760 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 9 Mar 2023 22:52:41 +0100 Subject: t0003: GETTEXT_POISON fix, conclusion In 3c50032ff528 (attr: ignore overly large gitattributes files, 2022-12-01), we backported a patch onto v2.30.* that was originally based on a much newer version. The v2.30.* release train still has the GETTEXT_POISON CI job, though, and hence needs `test_i18n*` in its tests. Signed-off-by: Johannes Schindelin --- t/t0003-attributes.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 't') diff --git a/t/t0003-attributes.sh b/t/t0003-attributes.sh index 5bd9d9832d..57ba303de8 100755 --- a/t/t0003-attributes.sh +++ b/t/t0003-attributes.sh @@ -366,7 +366,7 @@ test_expect_success EXPENSIVE 'large attributes file ignored in tree' ' dd if=/dev/zero of=.gitattributes bs=101M count=1 2>/dev/null && git check-attr --all path >/dev/null 2>err && echo "warning: ignoring overly large gitattributes file ${SQ}.gitattributes${SQ}" >expect && - test_cmp expect err + test_i18ncmp expect err ' test_expect_success 'large attributes line ignored in index' ' -- cgit v1.2.3 From a2b2173cfeed82347711862d20aabbb1a5478379 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 9 Mar 2023 22:56:06 +0100 Subject: t5619: GETTEXT_POISON fix In cf8f6ce02a13 (clone: delay picking a transport until after get_repo_path(), 2023-01-24), we backported a patch onto v2.30.* that was originally based on a much newer version. The v2.30.* release train still has the GETTEXT_POISON CI job, though, and hence needs `test_i18n*` in its tests. Signed-off-by: Johannes Schindelin --- t/t5619-clone-local-ambiguous-transport.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 't') diff --git a/t/t5619-clone-local-ambiguous-transport.sh b/t/t5619-clone-local-ambiguous-transport.sh index cce62bf78d..7eab09d02a 100755 --- a/t/t5619-clone-local-ambiguous-transport.sh +++ b/t/t5619-clone-local-ambiguous-transport.sh @@ -64,7 +64,7 @@ test_expect_success 'ambiguous transport does not lead to arbitrary file-inclusi # # This works for now, and if we ever fix the URL detection, it # is OK to change this to detect the transport error. - grep "protocol .* is not supported" err + test_i18ngrep "protocol .* is not supported" err ' test_done -- cgit v1.2.3 From 7c811ed5e55553769f0077ddf026ef17061bd8bd Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 9 Mar 2023 22:55:40 +0100 Subject: t5604: GETTEXT_POISON fix, part 1 In bffc762f87ae (dir-iterator: prevent top-level symlinks without FOLLOW_SYMLINKS, 2023-01-24), we backported a patch onto v2.30.* that was originally based on a much newer version. The v2.30.* release train still has the GETTEXT_POISON CI job, though, and hence needs `test_i18n*` in its tests. Signed-off-by: Johannes Schindelin --- t/t5604-clone-reference.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 't') diff --git a/t/t5604-clone-reference.sh b/t/t5604-clone-reference.sh index 4ff21d7ccf..9ba2af0ff7 100755 --- a/t/t5604-clone-reference.sh +++ b/t/t5604-clone-reference.sh @@ -354,7 +354,7 @@ test_expect_success SYMLINKS 'clone repo with symlinked objects directory' ' test_must_fail git clone --local malicious clone 2>err && test_path_is_missing clone && - grep "failed to start iterator over" err + test_i18ngrep "failed to start iterator over" err ' test_done -- cgit v1.2.3 From 0c8d22abaf155d97a0efd04bae9fcdad1de7956e Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 9 Mar 2023 22:54:32 +0100 Subject: t5604: GETTEXT_POISON fix, conclusion In fade728df122 (apply: fix writing behind newly created symbolic links, 2023-02-02), we backported a patch onto v2.30.* that was originally based on a much newer version. The v2.30.* release train still has the GETTEXT_POISON CI job, though, and hence needs `test_i18n*` in its tests. Signed-off-by: Johannes Schindelin --- t/t4115-apply-symlink.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 't') diff --git a/t/t4115-apply-symlink.sh b/t/t4115-apply-symlink.sh index 1acb7b2582..14e0f4d705 100755 --- a/t/t4115-apply-symlink.sh +++ b/t/t4115-apply-symlink.sh @@ -72,7 +72,7 @@ test_expect_success SYMLINKS 'symlink escape when creating new files' ' cat >expected_stderr <<-EOF && error: affected file ${SQ}renamed-symlink/create-me${SQ} is beyond a symbolic link EOF - test_cmp expected_stderr stderr && + test_i18ncmp expected_stderr stderr && ! test_path_exists .git/create-me ' -- cgit v1.2.3 From 9db05711c98efc14f414d4c87135a34c13586e0b Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 9 Mar 2023 16:02:54 +0100 Subject: apply --reject: overwrite existing `.rej` symlink if it exists The `git apply --reject` is expected to write out `.rej` files in case one or more hunks fail to apply cleanly. Historically, the command overwrites any existing `.rej` files. The idea being that apply/reject/edit cycles are relatively common, and the generated `.rej` files are not considered precious. But the command does not overwrite existing `.rej` symbolic links, and instead follows them. This is unsafe because the same patch could potentially create such a symbolic link and point at arbitrary paths outside the current worktree, and `git apply` would write the contents of the `.rej` file into that location. Therefore, let's make sure that any existing `.rej` file or symbolic link is removed before writing it. Reported-by: RyotaK Helped-by: Taylor Blau Helped-by: Junio C Hamano Helped-by: Linus Torvalds Signed-off-by: Johannes Schindelin --- apply.c | 14 ++++++++++++-- t/t4115-apply-symlink.sh | 15 +++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) (limited to 't') diff --git a/apply.c b/apply.c index d80382c940..6634e9c510 100644 --- a/apply.c +++ b/apply.c @@ -4558,7 +4558,7 @@ static int write_out_one_reject(struct apply_state *state, struct patch *patch) FILE *rej; char namebuf[PATH_MAX]; struct fragment *frag; - int cnt = 0; + int fd, cnt = 0; struct strbuf sb = STRBUF_INIT; for (cnt = 0, frag = patch->fragments; frag; frag = frag->next) { @@ -4598,7 +4598,17 @@ static int write_out_one_reject(struct apply_state *state, struct patch *patch) memcpy(namebuf, patch->new_name, cnt); memcpy(namebuf + cnt, ".rej", 5); - rej = fopen(namebuf, "w"); + fd = open(namebuf, O_CREAT | O_EXCL | O_WRONLY, 0666); + if (fd < 0) { + if (errno != EEXIST) + return error_errno(_("cannot open %s"), namebuf); + if (unlink(namebuf)) + return error_errno(_("cannot unlink '%s'"), namebuf); + fd = open(namebuf, O_CREAT | O_EXCL | O_WRONLY, 0666); + if (fd < 0) + return error_errno(_("cannot open %s"), namebuf); + } + rej = fdopen(fd, "w"); if (!rej) return error_errno(_("cannot open %s"), namebuf); diff --git a/t/t4115-apply-symlink.sh b/t/t4115-apply-symlink.sh index 14e0f4d705..2d03c4e4d1 100755 --- a/t/t4115-apply-symlink.sh +++ b/t/t4115-apply-symlink.sh @@ -125,4 +125,19 @@ test_expect_success SYMLINKS 'symlink escape when deleting file' ' test_path_is_file .git/delete-me ' +test_expect_success SYMLINKS '--reject removes .rej symlink if it exists' ' + test_when_finished "git reset --hard && git clean -dfx" && + + test_commit file && + echo modified >file.t && + git diff -- file.t >patch && + echo modified-again >file.t && + + ln -s foo file.t.rej && + test_must_fail git apply patch --reject 2>err && + test_i18ngrep "Rejected hunk" err && + test_path_is_missing foo && + test_path_is_file file.t.rej +' + test_done -- cgit v1.2.3 From 29198213c9163c1d552ee2bdbf78d2b09ccc98b8 Mon Sep 17 00:00:00 2001 From: Taylor Blau Date: Thu, 6 Apr 2023 11:42:03 -0400 Subject: t1300: demonstrate failure when renaming sections with long lines When renaming a configuration section which has an entry whose length exceeds the size of our buffer in config.c's implementation of `git_config_copy_or_rename_section_in_file()`, Git will incorrectly form a new configuration section with part of the data in the section being removed. In this instance, our first configuration file looks something like: [b] c = d [a] e = f [a] g = h Here, we have two configuration values, "b.c", and "a.g". The value "[a] e = f" belongs to the configuration value "b.c", and does not form its own section. However, when renaming the section 'a' to 'xyz', Git will write back "[xyz]\ne = f", but "[xyz]" is still attached to the value of "b.c", which is why "e = f" on its own line becomes a new entry called "b.e". A slightly different example embeds the section being renamed within another section. Demonstrate this failure in a test in t1300, which we will fix in the following commit. Co-authored-by: Johannes Schindelin Helped-by: Jeff King Signed-off-by: Johannes Schindelin Signed-off-by: Taylor Blau --- t/t1300-config.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 't') diff --git a/t/t1300-config.sh b/t/t1300-config.sh index 1a4156c704..cd8f744160 100755 --- a/t/t1300-config.sh +++ b/t/t1300-config.sh @@ -613,6 +613,26 @@ test_expect_success 'renaming to bogus section is rejected' ' test_must_fail git config --rename-section branch.zwei "bogus name" ' +test_expect_failure 'renaming a section with a long line' ' + { + printf "[b]\\n" && + printf " c = d %1024s [a] e = f\\n" " " && + printf "[a] g = h\\n" + } >y && + git config -f y --rename-section a xyz && + test_must_fail git config -f y b.e +' + +test_expect_failure 'renaming an embedded section with a long line' ' + { + printf "[b]\\n" && + printf " c = d %1024s [a] [foo] e = f\\n" " " && + printf "[a] g = h\\n" + } >y && + git config -f y --rename-section a xyz && + test_must_fail git config -f y foo.e +' + cat >> .git/config << EOF [branch "zwei"] a = 1 [branch "vier"] EOF -- cgit v1.2.3 From a5bb10fd5e74101e7c07da93e7c32bbe60f6173a Mon Sep 17 00:00:00 2001 From: Taylor Blau Date: Thu, 6 Apr 2023 14:07:58 -0400 Subject: config: avoid fixed-sized buffer when renaming/deleting a section MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When renaming (or deleting) a section of configuration, Git uses the function `git_config_copy_or_rename_section_in_file()` to rewrite the configuration file after applying the rename or deletion to the given section. To do this, Git repeatedly calls `fgets()` to read the existing configuration data into a fixed size buffer. When the configuration value under `old_name` exceeds the size of the buffer, we will call `fgets()` an additional time even if there is no newline in the configuration file, since our read length is capped at `sizeof(buf)`. If the first character of the buffer (after zero or more characters satisfying `isspace()`) is a '[', Git will incorrectly treat it as beginning a new section when the original section is being removed. In other words, a configuration value satisfying this criteria can incorrectly be considered as a new secftion instead of a variable in the original section. Avoid this issue by using a variable-width buffer in the form of a strbuf rather than a fixed-with region on the stack. A couple of small points worth noting: - Using a strbuf will cause us to allocate arbitrary sizes to match the length of each line. In practice, we don't expect any reasonable configuration files to have lines that long, and a bandaid will be introduced in a later patch to ensure that this is the case. - We are using strbuf_getwholeline() here instead of strbuf_getline() in order to match `fgets()`'s behavior of leaving the trailing LF character on the buffer (as well as a trailing NUL). This could be changed later, but using strbuf_getwholeline() changes the least about this function's implementation, so it is picked as the safest path. - It is temping to want to replace the loop to skip over characters matching isspace() at the beginning of the buffer with a convenience function like `strbuf_ltrim()`. But this is the wrong approach for a couple of reasons: First, it involves a potentially large and expensive `memmove()` which we would like to avoid. Second, and more importantly, we also *do* want to preserve those spaces to avoid changing the output of other sections. In all, this patch is a minimal replacement of the fixed-width buffer in `git_config_copy_or_rename_section_in_file()` to instead use a `struct strbuf`. Reported-by: André Baptista Reported-by: Vítor Pinho Helped-by: Patrick Steinhardt Co-authored-by: Johannes Schindelin Signed-off-by: Johannes Schindelin Signed-off-by: Taylor Blau --- config.c | 13 +++++++------ t/t1300-config.sh | 4 ++-- 2 files changed, 9 insertions(+), 8 deletions(-) (limited to 't') diff --git a/config.c b/config.c index 1137bd73af..524347676d 100644 --- a/config.c +++ b/config.c @@ -3091,7 +3091,7 @@ static int git_config_copy_or_rename_section_in_file(const char *config_filename char *filename_buf = NULL; struct lock_file lock = LOCK_INIT; int out_fd; - char buf[1024]; + struct strbuf buf = STRBUF_INIT; FILE *config_file = NULL; struct stat st; struct strbuf copystr = STRBUF_INIT; @@ -3132,14 +3132,14 @@ static int git_config_copy_or_rename_section_in_file(const char *config_filename goto out; } - while (fgets(buf, sizeof(buf), config_file)) { + while (!strbuf_getwholeline(&buf, config_file, '\n')) { unsigned i; int length; int is_section = 0; - char *output = buf; - for (i = 0; buf[i] && isspace(buf[i]); i++) + char *output = buf.buf; + for (i = 0; buf.buf[i] && isspace(buf.buf[i]); i++) ; /* do nothing */ - if (buf[i] == '[') { + if (buf.buf[i] == '[') { /* it's a section */ int offset; is_section = 1; @@ -3158,7 +3158,7 @@ static int git_config_copy_or_rename_section_in_file(const char *config_filename strbuf_reset(©str); } - offset = section_name_match(&buf[i], old_name); + offset = section_name_match(&buf.buf[i], old_name); if (offset > 0) { ret++; if (new_name == NULL) { @@ -3233,6 +3233,7 @@ out: out_no_rollback: free(filename_buf); config_store_data_clear(&store); + strbuf_release(&buf); return ret; } diff --git a/t/t1300-config.sh b/t/t1300-config.sh index cd8f744160..24c13b91db 100755 --- a/t/t1300-config.sh +++ b/t/t1300-config.sh @@ -613,7 +613,7 @@ test_expect_success 'renaming to bogus section is rejected' ' test_must_fail git config --rename-section branch.zwei "bogus name" ' -test_expect_failure 'renaming a section with a long line' ' +test_expect_success 'renaming a section with a long line' ' { printf "[b]\\n" && printf " c = d %1024s [a] e = f\\n" " " && @@ -623,7 +623,7 @@ test_expect_failure 'renaming a section with a long line' ' test_must_fail git config -f y b.e ' -test_expect_failure 'renaming an embedded section with a long line' ' +test_expect_success 'renaming an embedded section with a long line' ' { printf "[b]\\n" && printf " c = d %1024s [a] [foo] e = f\\n" " " && -- cgit v1.2.3 From 3bb3d6bac5f2b496dfa2862dc1a84cbfa9b4449a Mon Sep 17 00:00:00 2001 From: Taylor Blau Date: Wed, 12 Apr 2023 19:18:28 -0400 Subject: config.c: disallow overly-long lines in `copy_or_rename_section_in_file()` As a defense-in-depth measure to guard against any potentially-unknown buffer overflows in `copy_or_rename_section_in_file()`, refuse to work with overly-long lines in a gitconfig. Signed-off-by: Taylor Blau Signed-off-by: Johannes Schindelin --- config.c | 13 +++++++++++++ t/t1300-config.sh | 10 ++++++++++ 2 files changed, 23 insertions(+) (limited to 't') diff --git a/config.c b/config.c index e4189aa2d7..b8194dfd8a 100644 --- a/config.c +++ b/config.c @@ -3083,6 +3083,8 @@ static int section_name_is_ok(const char *name) return 1; } +#define GIT_CONFIG_MAX_LINE_LEN (512 * 1024) + /* if new_name == NULL, the section is removed instead */ static int git_config_copy_or_rename_section_in_file(const char *config_filename, const char *old_name, @@ -3097,6 +3099,7 @@ static int git_config_copy_or_rename_section_in_file(const char *config_filename struct stat st; struct strbuf copystr = STRBUF_INIT; struct config_store_data store; + uint32_t line_nr = 0; memset(&store, 0, sizeof(store)); @@ -3137,6 +3140,16 @@ static int git_config_copy_or_rename_section_in_file(const char *config_filename size_t i, length; int is_section = 0; char *output = buf.buf; + + line_nr++; + + if (buf.len >= GIT_CONFIG_MAX_LINE_LEN) { + ret = error(_("refusing to work with overly long line " + "in '%s' on line %"PRIuMAX), + config_filename, (uintmax_t)line_nr); + goto out; + } + for (i = 0; buf.buf[i] && isspace(buf.buf[i]); i++) ; /* do nothing */ if (buf.buf[i] == '[') { diff --git a/t/t1300-config.sh b/t/t1300-config.sh index 24c13b91db..de564cb8e5 100755 --- a/t/t1300-config.sh +++ b/t/t1300-config.sh @@ -633,6 +633,16 @@ test_expect_success 'renaming an embedded section with a long line' ' test_must_fail git config -f y foo.e ' +test_expect_success 'renaming a section with an overly-long line' ' + { + printf "[b]\\n" && + printf " c = d %525000s e" " " && + printf "[a] g = h\\n" + } >y && + test_must_fail git config -f y --rename-section a xyz 2>err && + test_i18ngrep "refusing to work with overly long line in .y. on line 2" err +' + cat >> .git/config << EOF [branch "zwei"] a = 1 [branch "vier"] EOF -- cgit v1.2.3 From 92957d84271d8a54604df0a78c4318485c607ef6 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Sat, 11 Mar 2023 18:02:04 +0100 Subject: tests: avoid using `test_i18ncmp` Since `test_i18ncmp` was deprecated in v2.31.*, the instances added in v2.30.9 needed to be converted to `test_cmp` calls. Signed-off-by: Johannes Schindelin --- t/t0003-attributes.sh | 10 +++++----- t/t4115-apply-symlink.sh | 2 +- t/t6300-for-each-ref.sh | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 't') diff --git a/t/t0003-attributes.sh b/t/t0003-attributes.sh index 57ba303de8..9d9aa2855d 100755 --- a/t/t0003-attributes.sh +++ b/t/t0003-attributes.sh @@ -344,7 +344,7 @@ test_expect_success 'large attributes line ignored in tree' ' printf "path %02043d" 1 >.gitattributes && git check-attr --all path >actual 2>err && echo "warning: ignoring overly long attributes line 1" >expect && - test_i18ncmp expect err && + test_cmp expect err && test_must_be_empty actual ' @@ -357,7 +357,7 @@ test_expect_success 'large attributes line ignores trailing content in tree' ' printf "a %02045dtrailing attribute\n" 1 >.gitattributes && git check-attr --all trailing >actual 2>err && echo "warning: ignoring overly long attributes line 1" >expect && - test_i18ncmp expect err && + test_cmp expect err && test_must_be_empty actual ' @@ -366,7 +366,7 @@ test_expect_success EXPENSIVE 'large attributes file ignored in tree' ' dd if=/dev/zero of=.gitattributes bs=101M count=1 2>/dev/null && git check-attr --all path >/dev/null 2>err && echo "warning: ignoring overly large gitattributes file ${SQ}.gitattributes${SQ}" >expect && - test_i18ncmp expect err + test_cmp expect err ' test_expect_success 'large attributes line ignored in index' ' @@ -375,7 +375,7 @@ test_expect_success 'large attributes line ignored in index' ' git update-index --add --cacheinfo 100644,$blob,.gitattributes && git check-attr --cached --all path >actual 2>err && echo "warning: ignoring overly long attributes line 1" >expect && - test_i18ncmp expect err && + test_cmp expect err && test_must_be_empty actual ' @@ -385,7 +385,7 @@ test_expect_success 'large attributes line ignores trailing content in index' ' git update-index --add --cacheinfo 100644,$blob,.gitattributes && git check-attr --cached --all trailing >actual 2>err && echo "warning: ignoring overly long attributes line 1" >expect && - test_i18ncmp expect err && + test_cmp expect err && test_must_be_empty actual ' diff --git a/t/t4115-apply-symlink.sh b/t/t4115-apply-symlink.sh index 2d03c4e4d1..2b034ff771 100755 --- a/t/t4115-apply-symlink.sh +++ b/t/t4115-apply-symlink.sh @@ -72,7 +72,7 @@ test_expect_success SYMLINKS 'symlink escape when creating new files' ' cat >expected_stderr <<-EOF && error: affected file ${SQ}renamed-symlink/create-me${SQ} is beyond a symbolic link EOF - test_i18ncmp expected_stderr stderr && + test_cmp expected_stderr stderr && ! test_path_exists .git/create-me ' diff --git a/t/t6300-for-each-ref.sh b/t/t6300-for-each-ref.sh index cac7f443d0..7cfa934913 100755 --- a/t/t6300-for-each-ref.sh +++ b/t/t6300-for-each-ref.sh @@ -945,9 +945,9 @@ test_failing_trailer_option () { test_expect_success "$title" ' # error message cannot be checked under i18n test_must_fail git for-each-ref --format="%($option)" refs/heads/main 2>actual && - test_i18ncmp expect actual && + test_cmp expect actual && test_must_fail git for-each-ref --format="%(contents:$option)" refs/heads/main 2>actual && - test_i18ncmp expect actual + test_cmp expect actual ' } @@ -966,7 +966,7 @@ test_expect_success 'if arguments, %(contents:trailers) shows error if colon is fatal: unrecognized %(contents) argument: trailersonly EOF test_must_fail git for-each-ref --format="%(contents:trailersonly)" 2>actual && - test_i18ncmp expect actual + test_cmp expect actual ' test_expect_success 'basic atom: head contents:trailers' ' -- cgit v1.2.3