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
6a61a418
Unverified
Commit
6a61a418
authored
Feb 08, 2020
by
Edward Thomson
Committed by
GitHub
Feb 08, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5393 from pks-t/pks/tests-iterator-missing-ref
tests: iterator: fix iterator expecting too few items
parents
03ac24b1
26b71d60
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
tests/iterator/workdir.c
+9
-9
No files found.
tests/iterator/workdir.c
View file @
6a61a418
...
...
@@ -637,13 +637,14 @@ void test_iterator_workdir__filesystem2(void)
git_iterator_free
(
i
);
}
/* Lots of empty dirs, or nearly empty ones, make the old workdir
* iterator cry. Also, segfault.
/*
* Lots of empty dirs, or nearly empty ones, make the old workdir
* iterator cry. Also, segfault.
*/
void
test_iterator_workdir__filesystem_gunk
(
void
)
{
git_iterator
*
i
;
git_buf
parent
=
GIT_BUF_INIT
;
git_iterator
*
i
;
int
n
;
if
(
!
cl_is_env_set
(
"GITTEST_INVASIVE_SPEED"
))
...
...
@@ -653,19 +654,18 @@ void test_iterator_workdir__filesystem_gunk(void)
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_buf_printf
(
&
parent
,
"%s/refs/heads/foo/%d/subdir"
,
git_repository_path
(
g_repo
),
n
));
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 16 items, since we're not asking for trees to be
/*
* Should only have 17 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
,
16
,
NULL
,
15
,
NULL
);
expect_iterator_items
(
i
,
17
,
NULL
,
16
,
NULL
);
git_iterator_free
(
i
);
git_buf_dispose
(
&
parent
);
}
...
...
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