mirror of
https://github.com/octoleo/syncthing.git
synced 2024-12-23 11:28:59 +00:00
Merge pull request #2724 from plouj/master
rest/db/scan: Only scan the requested subdirectories/files.
This commit is contained in:
commit
cc5f93e717
@ -1323,15 +1323,14 @@ func (m *Model) internalScanFolderSubs(folder string, subs []string) error {
|
|||||||
var unifySubs []string
|
var unifySubs []string
|
||||||
nextSub:
|
nextSub:
|
||||||
for _, sub := range subs {
|
for _, sub := range subs {
|
||||||
for sub != "" {
|
for sub != "" && sub != ".stfolder" && sub != ".stignore" {
|
||||||
parent := filepath.Dir(sub)
|
if _, ok = fs.Get(protocol.LocalDeviceID, sub); ok {
|
||||||
if parent == "." || parent == string(filepath.Separator) {
|
|
||||||
parent = ""
|
|
||||||
}
|
|
||||||
if _, ok = fs.Get(protocol.LocalDeviceID, parent); ok {
|
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
sub = parent
|
sub = filepath.Dir(sub)
|
||||||
|
if sub == "." || sub == string(filepath.Separator) {
|
||||||
|
sub = ""
|
||||||
|
}
|
||||||
}
|
}
|
||||||
for _, us := range unifySubs {
|
for _, us := range unifySubs {
|
||||||
if strings.HasPrefix(sub, us) {
|
if strings.HasPrefix(sub, us) {
|
||||||
|
Loading…
Reference in New Issue
Block a user