Commit cdbbb364 by Edward Thomson

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.
parent ff25ec83
......@@ -80,6 +80,29 @@ void test_filter_bare__from_lf(void)
git_blob_free(blob);
}
void test_filter_bare__nested_attributes(void)
{
git_blob *blob;
git_buf buf = { 0 };
cl_git_pass(git_revparse_single(
(git_object **)&blob, g_repo, "799770d")); /* all-lf */
cl_assert_equal_s(ALL_LF_TEXT_RAW, git_blob_rawcontent(blob));
cl_git_pass(git_blob_filter(&buf, blob, "raw/file.bin", &filter_opts));
cl_assert_equal_s(ALL_LF_TEXT_RAW, buf.ptr);
cl_git_pass(git_blob_filter(&buf, blob, "raw/file.crlf", &filter_opts));
cl_assert_equal_s(ALL_LF_TEXT_RAW, buf.ptr);
cl_git_pass(git_blob_filter(&buf, blob, "raw/file.lf", &filter_opts));
cl_assert_equal_s(ALL_LF_TEXT_RAW, buf.ptr);
git_buf_dispose(&buf);
git_blob_free(blob);
}
void test_filter_bare__sanitizes(void)
{
git_blob *blob;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment