-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pattern-based exceptions in .gitignore not working #3224
Comments
Doing a bit more testing, this exception works: |
It looks like the void test_status_ignore__deeper(void)
{
int ignored;
g_repo = cl_git_sandbox_init("empty_standard_repo");
cl_git_mkfile("empty_standard_repo/.gitignore",
"*.data\n"
"!dont_ignore/*.data\n");
cl_git_pass(p_mkdir("empty_standard_repo/dont_ignore", 0777));
cl_git_mkfile("empty_standard_repo/foo.data", "");
cl_git_mkfile("empty_standard_repo/bar.data", "");
cl_git_mkfile("empty_standard_repo/dont_ignore/foo.data", "");
cl_git_mkfile("empty_standard_repo/dont_ignore/bar.data", "");
cl_git_pass(git_ignore_path_is_ignored(&ignored, g_repo, "foo.data"));
cl_assert_equal_i(1, ignored);
cl_git_pass(git_ignore_path_is_ignored(&ignored, g_repo, "bar.data"));
cl_assert_equal_i(1, ignored);
cl_git_pass(git_ignore_path_is_ignored(&ignored, g_repo, "dont_ignore/foo.data"));
cl_assert_equal_i(0, ignored);
cl_git_pass(git_ignore_path_is_ignored(&ignored, g_repo, "dont_ignore/bar.data"));
cl_assert_equal_i(0, ignored);
} |
Just found this issue as well. |
I believe that there is an issue in the Atom tree-view project that is caused by this via Atom's git-utils' project's dependency on this project. It looks like the project is using v0.24.3 of libgit2. |
Not sure if this is the same, but in the CPython repository they have this:
The "Python" directory is ignored by libgit2 but not by Git. Tested on Windows. |
@segevfiner I guess your issue is different, as it is caused by issues with case-insensitivity. It would be very nice if you could create a new issue describing the problem. |
This issue should have been closed when #4296 was merged but wasn't |
Thanks @vringar ! |
Example case:
Then add a couple files in the workdir:
foo.data
anddont_ignore/bar.data
.git_diff_index_to_workdir()
will correctly ignorefoo.data
but incorrectly also ignoredont_ignore/bar.data
.Note that the
.gitignore
file is working as expected when testing withgit status --ignored
.The text was updated successfully, but these errors were encountered: