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
32cc5edc
Commit
32cc5edc
authored
Jul 07, 2017
by
Patrick Steinhardt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests: status: additional test for negative ignores with pattern
This test is by Carlos Martín Nieto.
parent
5c15cd94
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
+27
-0
tests/status/ignore.c
+27
-0
No files found.
tests/status/ignore.c
View file @
32cc5edc
...
@@ -1155,3 +1155,30 @@ void test_status_ignore__subdir_ignore_everything_except_certain_files(void)
...
@@ -1155,3 +1155,30 @@ void test_status_ignore__subdir_ignore_everything_except_certain_files(void)
refute_is_ignored
(
"project/src/foo.c"
);
refute_is_ignored
(
"project/src/foo.c"
);
refute_is_ignored
(
"project/src/foo/foo.c"
);
refute_is_ignored
(
"project/src/foo/foo.c"
);
}
}
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
);
}
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