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
d051de24
Commit
d051de24
authored
Mar 10, 2016
by
Edward Thomson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
iterator: test fs iterator w/ many nested empty dirs
parent
a4f520a6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
0 deletions
+30
-0
tests/repo/iterator.c
+30
-0
No files found.
tests/repo/iterator.c
View file @
d051de24
...
...
@@ -1012,6 +1012,36 @@ void test_repo_iterator__fs2(void)
git_iterator_free
(
i
);
}
void
test_repo_iterator__fs_gunk
(
void
)
{
git_iterator
*
i
;
git_buf
parent
=
GIT_BUF_INIT
;
int
n
;
if
(
!
cl_is_env_set
(
"GITTEST_INVASIVE_FS_STRUCTURE"
))
cl_skip
();
g_repo
=
cl_git_sandbox_init
(
"testrepo"
);
for
(
n
=
0
;
n
<
100000
;
n
++
)
{
git_buf_clear
(
&
parent
);
git_buf_printf
(
&
parent
,
"%s/refs/heads/foo/%d/subdir"
,
git_repository_path
(
g_repo
),
n
);
cl_assert
(
!
git_buf_oom
(
&
parent
));
cl_git_pass
(
git_futils_mkdir
(
parent
.
ptr
,
0775
,
GIT_MKDIR_PATH
));
}
cl_git_pass
(
git_iterator_for_filesystem
(
&
i
,
"testrepo/.git/refs"
,
NULL
));
/* should only have 13 items, since we're not asking for trees to be
* returned. the goal of this test is simply to not crash.
*/
expect_iterator_items
(
i
,
13
,
NULL
,
13
,
NULL
);
git_iterator_free
(
i
);
git_buf_free
(
&
parent
);
}
void
test_repo_iterator__skips_unreadable_dirs
(
void
)
{
git_iterator
*
i
;
...
...
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