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
5a190ad3
Unverified
Commit
5a190ad3
authored
Apr 07, 2019
by
Edward Thomson
Committed by
GitHub
Apr 07, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5040 from pks-t/pks/ignore-treat-dirpaths-as-dir
ignore: treat paths with trailing "/" as directories
parents
aeea1c46
9d117e20
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
1 deletions
+19
-1
src/ignore.c
+3
-1
tests/attr/ignore.c
+16
-0
No files found.
src/ignore.c
View file @
5a190ad3
...
...
@@ -534,7 +534,9 @@ int git_ignore_path_is_ignored(
memset
(
&
path
,
0
,
sizeof
(
path
));
memset
(
&
ignores
,
0
,
sizeof
(
ignores
));
if
(
git_repository_is_bare
(
repo
))
if
(
!
git__suffixcmp
(
pathname
,
"/"
))
dir_flag
=
GIT_DIR_FLAG_TRUE
;
else
if
(
git_repository_is_bare
(
repo
))
dir_flag
=
GIT_DIR_FLAG_FALSE
;
if
((
error
=
git_attr_path__init
(
&
path
,
pathname
,
workdir
,
dir_flag
))
<
0
||
...
...
tests/attr/ignore.c
View file @
5a190ad3
...
...
@@ -397,3 +397,19 @@ void test_attr_ignore__ignored_subdirfiles_with_negations(void)
assert_is_ignored
(
true
,
"dir/sub1/c.test"
);
}
void
test_attr_ignore__negative_directory_rules_only_match_directories
(
void
)
{
cl_git_rewritefile
(
"attr/.gitignore"
,
"*
\n
"
"!/**/
\n
"
"!*.keep
\n
"
"!.gitignore
\n
"
);
assert_is_ignored
(
true
,
"src"
);
assert_is_ignored
(
true
,
"src/A"
);
assert_is_ignored
(
false
,
"src/"
);
assert_is_ignored
(
false
,
"src/A.keep"
);
assert_is_ignored
(
false
,
".gitignore"
);
}
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