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
644592bc
Commit
644592bc
authored
May 02, 2014
by
Vicent Marti
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2320 from libgit2/rb/fix-starstar-again
Make ** pattern eat trailing slash
parents
9d878fc4
d19b2f9f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
0 deletions
+20
-0
src/fnmatch.c
+2
-0
tests/attr/ignore.c
+18
-0
No files found.
src/fnmatch.c
View file @
644592bc
...
...
@@ -62,6 +62,8 @@ p_fnmatchx(const char *pattern, const char *string, int flags, size_t recurs)
flags
&=
~
FNM_PATHNAME
;
while
(
c
==
'*'
)
c
=
*++
pattern
;
if
(
c
==
'/'
)
c
=
*++
pattern
;
}
if
(
*
string
==
'.'
&&
(
flags
&
FNM_PERIOD
)
&&
...
...
tests/attr/ignore.c
View file @
644592bc
...
...
@@ -81,6 +81,24 @@ void test_attr_ignore__full_paths(void)
assert_is_ignored
(
false
,
"Folder/Middle/More/More/Contained/Not/Happy/Child"
);
}
void
test_attr_ignore__more_starstar_cases
(
void
)
{
cl_must_pass
(
p_unlink
(
"attr/.gitignore"
));
cl_git_mkfile
(
"attr/dir/.gitignore"
,
"sub/**/*.html
\n
"
);
assert_is_ignored
(
false
,
"aaa.html"
);
assert_is_ignored
(
false
,
"dir"
);
assert_is_ignored
(
false
,
"dir/sub"
);
assert_is_ignored
(
true
,
"dir/sub/sub2/aaa.html"
);
assert_is_ignored
(
true
,
"dir/sub/aaa.html"
);
assert_is_ignored
(
false
,
"dir/aaa.html"
);
assert_is_ignored
(
false
,
"sub"
);
assert_is_ignored
(
false
,
"sub/aaa.html"
);
assert_is_ignored
(
false
,
"sub/sub2/aaa.html"
);
}
void
test_attr_ignore__leading_stars
(
void
)
{
cl_git_rewritefile
(
...
...
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