Skip to content

Commit cdbbb36

Browse files
committed
filter: test second-level in-repo .gitattributes
Ensure that a `.gitattributes` file that is deeper in the tree is honored, not just an attributes file at the root.
1 parent ff25ec8 commit cdbbb36

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tests/filter/bare.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,29 @@ void test_filter_bare__from_lf(void)
8080
git_blob_free(blob);
8181
}
8282

83+
void test_filter_bare__nested_attributes(void)
84+
{
85+
git_blob *blob;
86+
git_buf buf = { 0 };
87+
88+
cl_git_pass(git_revparse_single(
89+
(git_object **)&blob, g_repo, "799770d")); /* all-lf */
90+
91+
cl_assert_equal_s(ALL_LF_TEXT_RAW, git_blob_rawcontent(blob));
92+
93+
cl_git_pass(git_blob_filter(&buf, blob, "raw/file.bin", &filter_opts));
94+
cl_assert_equal_s(ALL_LF_TEXT_RAW, buf.ptr);
95+
96+
cl_git_pass(git_blob_filter(&buf, blob, "raw/file.crlf", &filter_opts));
97+
cl_assert_equal_s(ALL_LF_TEXT_RAW, buf.ptr);
98+
99+
cl_git_pass(git_blob_filter(&buf, blob, "raw/file.lf", &filter_opts));
100+
cl_assert_equal_s(ALL_LF_TEXT_RAW, buf.ptr);
101+
102+
git_buf_dispose(&buf);
103+
git_blob_free(blob);
104+
}
105+
83106
void test_filter_bare__sanitizes(void)
84107
{
85108
git_blob *blob;

0 commit comments

Comments
 (0)