Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
db0682a4
Commit
db0682a4
authored
May 25, 2021
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
db/update/Walk: move code to LoadExcludeList()
parent
7a6823dc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
11 deletions
+24
-11
Walk.cxx
src/db/update/Walk.cxx
+24
-11
No files found.
src/db/update/Walk.cxx
View file @
db0682a4
...
...
@@ -312,6 +312,29 @@ UpdateWalk::SkipSymlink(const Directory *directory,
#endif
}
static
void
LoadExcludeListOrThrow
(
const
Storage
&
storage
,
const
Directory
&
directory
,
ExcludeList
&
exclude_list
)
{
Mutex
mutex
;
auto
is
=
InputStream
::
OpenReady
(
storage
.
MapUTF8
(
PathTraitsUTF8
::
Build
(
directory
.
GetPath
(),
".mpdignore"
)).
c_str
(),
mutex
);
exclude_list
.
Load
(
std
::
move
(
is
));
}
static
void
LoadExcludeListOrLog
(
const
Storage
&
storage
,
const
Directory
&
directory
,
ExcludeList
&
exclude_list
)
noexcept
{
try
{
LoadExcludeListOrThrow
(
storage
,
directory
,
exclude_list
);
}
catch
(...)
{
if
(
!
IsFileNotFound
(
std
::
current_exception
()))
LogError
(
std
::
current_exception
());
}
}
bool
UpdateWalk
::
UpdateDirectory
(
Directory
&
directory
,
const
ExcludeList
&
exclude_list
,
...
...
@@ -331,17 +354,7 @@ UpdateWalk::UpdateDirectory(Directory &directory,
}
ExcludeList
child_exclude_list
(
exclude_list
);
try
{
Mutex
mutex
;
auto
is
=
InputStream
::
OpenReady
(
storage
.
MapUTF8
(
PathTraitsUTF8
::
Build
(
directory
.
GetPath
(),
".mpdignore"
)).
c_str
(),
mutex
);
child_exclude_list
.
Load
(
std
::
move
(
is
));
}
catch
(...)
{
if
(
!
IsFileNotFound
(
std
::
current_exception
()))
LogError
(
std
::
current_exception
());
}
LoadExcludeListOrLog
(
storage
,
directory
,
child_exclude_list
);
if
(
!
child_exclude_list
.
IsEmpty
())
RemoveExcludedFromDirectory
(
directory
,
child_exclude_list
);
...
...
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