Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
3e85be2b
Commit
3e85be2b
authored
May 20, 2015
by
Edward Thomson
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3144 from libgit2/cmn/ignored-ignore
ignore: clear the error when matching a pattern negation
parents
cd3f3c28
2c57114f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
src/ignore.c
+1
-0
tests/status/ignore.c
+12
-0
No files found.
src/ignore.c
View file @
3e85be2b
...
...
@@ -80,6 +80,7 @@ static int does_negate_rule(int *out, git_vector *rules, git_attr_fnmatch *match
git_vector_foreach
(
rules
,
i
,
rule
)
{
if
(
!
(
rule
->
flags
&
GIT_ATTR_FNMATCH_HASWILD
))
{
if
(
does_negate_pattern
(
rule
,
match
))
{
error
=
0
;
*
out
=
1
;
goto
out
;
}
...
...
tests/status/ignore.c
View file @
3e85be2b
...
...
@@ -1010,3 +1010,15 @@ void test_status_ignore__subdir_doesnt_match_above(void)
cl_git_pass
(
git_ignore_path_is_ignored
(
&
ignored
,
g_repo
,
"src/SRC/test.txt"
));
cl_assert_equal_i
(
icase
,
ignored
);
}
void
test_status_ignore__negate_exact_previous
(
void
)
{
int
ignored
;
g_repo
=
cl_git_sandbox_init
(
"empty_standard_repo"
);
cl_git_mkfile
(
"empty_standard_repo/.gitignore"
,
"*.com
\n
tags
\n
!tags/
\n
.buildpath"
);
cl_git_mkfile
(
"empty_standard_repo/.buildpath"
,
""
);
cl_git_pass
(
git_ignore_path_is_ignored
(
&
ignored
,
g_repo
,
".buildpath"
));
cl_assert_equal_i
(
1
,
ignored
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment