Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3-files
Commits
241cb611
Commit
241cb611
authored
Mar 29, 2020
by
Steven Allen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: skip ignored files when calculating size
fixes
https://github.com/ipfs/go-ipfs/issues/7052
parent
642f445c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
serialfile.go
serialfile.go
+7
-2
No files found.
serialfile.go
View file @
241cb611
...
...
@@ -138,13 +138,18 @@ func (f *serialFile) Size() (int64, error) {
var
du
int64
err
:=
filepath
.
Walk
(
f
.
path
,
func
(
p
string
,
fi
os
.
FileInfo
,
err
error
)
error
{
if
err
!=
nil
{
if
err
!=
nil
||
fi
==
nil
{
return
err
}
if
fi
!=
nil
&&
fi
.
Mode
()
.
IsRegular
()
{
if
f
.
filter
.
ShouldExclude
(
fi
)
{
if
fi
.
Mode
()
.
IsDir
()
{
return
filepath
.
SkipDir
}
}
else
if
fi
.
Mode
()
.
IsRegular
()
{
du
+=
fi
.
Size
()
}
return
nil
})
...
...
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