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
d788499a
Commit
d788499a
authored
Feb 22, 2013
by
nulltoken
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ignore: enhance git_ignore_path_is_ignored() test coverage
parent
0309e850
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
0 deletions
+32
-0
tests-clar/attr/ignore.c
+32
-0
No files found.
tests-clar/attr/ignore.c
0 → 100644
View file @
d788499a
#include "clar_libgit2.h"
static
git_repository
*
g_repo
=
NULL
;
void
test_attr_ignore__initialize
(
void
)
{
g_repo
=
cl_git_sandbox_init
(
"attr"
);
}
void
test_attr_ignore__cleanup
(
void
)
{
cl_git_sandbox_cleanup
();
g_repo
=
NULL
;
}
void
assert_is_ignored
(
bool
expected
,
const
char
*
filepath
)
{
int
is_ignored
;
cl_git_pass
(
git_ignore_path_is_ignored
(
&
is_ignored
,
g_repo
,
filepath
));
cl_assert_equal_i
(
expected
,
is_ignored
==
1
);
}
void
test_attr_ignore__honor_temporary_rules
(
void
)
{
cl_git_rewritefile
(
"attr/.gitignore"
,
"/NewFolder
\n
/NewFolder/NewFolder"
);
assert_is_ignored
(
false
,
"File.txt"
);
assert_is_ignored
(
true
,
"NewFolder"
);
assert_is_ignored
(
true
,
"NewFolder/NewFolder"
);
assert_is_ignored
(
true
,
"NewFolder/NewFolder/File.txt"
);
}
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