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
9d4b7d25
Commit
9d4b7d25
authored
9 years ago
by
Edward Thomson
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3328 from libgit2/cmn/iterator-skip-diriter
iterator: skip over errors in diriter init
parents
a8058ffd
0e391d85
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
6 deletions
+5
-6
src/iterator.c
+4
-1
tests/repo/iterator.c
+1
-5
No files found.
src/iterator.c
View file @
9d4b7d25
...
...
@@ -1027,8 +1027,11 @@ static int dirload_with_stat(
strncomp
=
(
flags
&
GIT_PATH_DIR_IGNORE_CASE
)
!=
0
?
git__strncasecmp
:
git__strncmp
;
if
((
error
=
git_path_diriter_init
(
&
diriter
,
dirpath
,
flags
))
<
0
)
/* Any error here is equivalent to the dir not existing, skip over it */
if
((
error
=
git_path_diriter_init
(
&
diriter
,
dirpath
,
flags
))
<
0
)
{
error
=
GIT_ENOTFOUND
;
goto
done
;
}
while
((
error
=
git_path_diriter_next
(
&
diriter
))
==
0
)
{
if
((
error
=
git_path_diriter_fullpath
(
&
path
,
&
path_len
,
&
diriter
))
<
0
)
...
...
This diff is collapsed.
Click to expand it.
tests/repo/iterator.c
View file @
9d4b7d25
...
...
@@ -928,7 +928,7 @@ void test_repo_iterator__fs2(void)
git_iterator_free
(
i
);
}
void
test_repo_iterator__
fs_preserves_erro
r
(
void
)
void
test_repo_iterator__
unreadable_di
r
(
void
)
{
git_iterator
*
i
;
const
git_index_entry
*
e
;
...
...
@@ -951,10 +951,6 @@ void test_repo_iterator__fs_preserves_error(void)
cl_git_pass
(
git_iterator_advance
(
&
e
,
i
));
/* a */
cl_git_fail
(
git_iterator_advance
(
&
e
,
i
));
/* b */
cl_assert
(
giterr_last
());
cl_assert
(
giterr_last
()
->
message
!=
NULL
);
/* skip 'c/' empty directory */
cl_git_pass
(
git_iterator_advance
(
&
e
,
i
));
/* d */
cl_assert_equal_i
(
GIT_ITEROVER
,
git_iterator_advance
(
&
e
,
i
));
cl_must_pass
(
p_chmod
(
"empty_standard_repo/r/b"
,
0777
));
...
...
This diff is collapsed.
Click to expand it.
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