mirror of
https://github.com/libgit2/libgit2.git
synced 2026-06-22 06:26:26 +00:00
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.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user