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
882cc37f
Commit
882cc37f
authored
May 13, 2015
by
Edward Thomson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
attr tests: make explicit our dir/file match tests
parent
34593aae
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
12 deletions
+24
-12
tests/attr/ignore.c
+24
-12
No files found.
tests/attr/ignore.c
View file @
882cc37f
...
@@ -207,7 +207,6 @@ void test_attr_ignore__gitignore_in_subdir(void)
...
@@ -207,7 +207,6 @@ void test_attr_ignore__gitignore_in_subdir(void)
assert_is_ignored
(
false
,
"dir1/file"
);
assert_is_ignored
(
false
,
"dir1/file"
);
assert_is_ignored
(
false
,
"dir1/dir2/file"
);
assert_is_ignored
(
false
,
"dir1/dir2/file"
);
assert_is_ignored
(
false
,
"dir1/dir2/dir3/file"
);
assert_is_ignored
(
false
,
"dir1/dir2/dir3/file"
);
assert_is_ignored
(
false
,
"dir1/dir2/dir3/dir1"
);
assert_is_ignored
(
true
,
"dir1/dir2/dir3/dir1/file"
);
assert_is_ignored
(
true
,
"dir1/dir2/dir3/dir1/file"
);
assert_is_ignored
(
true
,
"dir1/dir2/dir3/dir1/subdir/foo"
);
assert_is_ignored
(
true
,
"dir1/dir2/dir3/dir1/subdir/foo"
);
...
@@ -217,26 +216,39 @@ void test_attr_ignore__gitignore_in_subdir(void)
...
@@ -217,26 +216,39 @@ void test_attr_ignore__gitignore_in_subdir(void)
assert_is_ignored
(
false
,
"dir1/file"
);
assert_is_ignored
(
false
,
"dir1/file"
);
assert_is_ignored
(
false
,
"dir1/dir2/file"
);
assert_is_ignored
(
false
,
"dir1/dir2/file"
);
assert_is_ignored
(
false
,
"dir1/dir2/dir3/file"
);
assert_is_ignored
(
false
,
"dir1/dir2/dir3/file"
);
assert_is_ignored
(
false
,
"dir1/dir2/dir3/dir1"
);
assert_is_ignored
(
true
,
"dir1/dir2/dir3/dir1/file"
);
assert_is_ignored
(
true
,
"dir1/dir2/dir3/dir1/file"
);
assert_is_ignored
(
true
,
"dir1/dir2/dir3/dir1/subdir/foo"
);
assert_is_ignored
(
true
,
"dir1/dir2/dir3/dir1/subdir/foo"
);
}
}
}
}
void
test_attr_ignore__depth_file_not_ignored_when_folder_specified
(
void
)
/* Ensure that files do not match folder cases */
void
test_attr_ignore__dont_ignore_files_for_folder
(
void
)
{
{
cl_git_rmfile
(
"attr/.gitignore"
);
cl_git_rmfile
(
"attr/.gitignore"
);
cl_must_pass
(
p_mkdir
(
"attr/dir1"
,
0777
));
cl_git_mkfile
(
"attr/dir/.gitignore"
,
"test/
\n
"
);
cl_must_pass
(
p_mkdir
(
"attr/dir1/dir2"
,
0777
));
cl_must_pass
(
p_mkdir
(
"attr/dir1/dir2/dir3"
,
0777
));
cl_git_mkfile
(
"attr/dir1/dir2/dir3/.gitignore"
,
"dir1/
\n
"
);
/* Create "test" as a file; ensure it is not ignored. */
cl_git_mkfile
(
"attr/dir/test"
,
"This is a file."
);
assert_is_ignored
(
false
,
"dir1/dir2/dir3/dir1"
);
assert_is_ignored
(
false
,
"dir/test"
);
if
(
cl_repo_get_bool
(
g_repo
,
"core.ignorecase"
))
assert_is_ignored
(
false
,
"dir/TeSt"
);
if
(
cl_repo_get_bool
(
g_repo
,
"core.ignorecase"
))
{
/* Create "test" as a directory; ensure it is ignored. */
assert_is_ignored
(
false
,
"dir1/dir2/dir3/DiR1"
);
cl_git_rmfile
(
"attr/dir/test"
);
}
cl_must_pass
(
p_mkdir
(
"attr/dir/test"
,
0777
));
}
assert_is_ignored
(
true
,
"dir/test"
);
if
(
cl_repo_get_bool
(
g_repo
,
"core.ignorecase"
))
assert_is_ignored
(
true
,
"dir/TeSt"
);
/* Remove "test" entirely; ensure it is not ignored.
* (As it doesn't exist, it is not a directory.)
*/
cl_must_pass
(
p_rmdir
(
"attr/dir/test"
));
assert_is_ignored
(
false
,
"dir/test"
);
if
(
cl_repo_get_bool
(
g_repo
,
"core.ignorecase"
))
assert_is_ignored
(
false
,
"dir/TeSt"
);
}
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