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-mfs
Commits
5b039fd0
Unverified
Commit
5b039fd0
authored
Mar 19, 2019
by
Steven Allen
Committed by
GitHub
Mar 19, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #72 from ipfs/feat/flush-ret-node
Return node from FlushPath
parents
dd7a682a
d9d9b305
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
8 deletions
+12
-8
mfs_test.go
mfs_test.go
+8
-4
ops.go
ops.go
+4
-4
No files found.
mfs_test.go
View file @
5b039fd0
...
...
@@ -817,19 +817,23 @@ func TestFlushing(t *testing.T) {
t
.
Fatal
(
err
)
}
if
err
:=
FlushPath
(
ctx
,
rt
,
"/a/b/c/TEST"
);
err
!=
nil
{
nd
,
err
:=
FlushPath
(
ctx
,
rt
,
"/a/b/c/TEST"
)
if
err
!=
nil
{
t
.
Fatal
(
err
)
}
if
nd
.
Cid
()
.
String
()
!=
"QmYi7wrRFKVCcTB56A6Pep2j31Q5mHfmmu21RzHXu25RVR"
{
t
.
Fatalf
(
"unexpected node from FlushPath: %s"
,
nd
.
Cid
())
}
if
err
:=
FlushPath
(
ctx
,
rt
,
"/a/b/d/TEST"
);
err
!=
nil
{
if
_
,
err
:=
FlushPath
(
ctx
,
rt
,
"/a/b/d/TEST"
);
err
!=
nil
{
t
.
Fatal
(
err
)
}
if
err
:=
FlushPath
(
ctx
,
rt
,
"/a/b/e/TEST"
);
err
!=
nil
{
if
_
,
err
:=
FlushPath
(
ctx
,
rt
,
"/a/b/e/TEST"
);
err
!=
nil
{
t
.
Fatal
(
err
)
}
if
err
:=
FlushPath
(
ctx
,
rt
,
"/FILE"
);
err
!=
nil
{
if
_
,
err
:=
FlushPath
(
ctx
,
rt
,
"/FILE"
);
err
!=
nil
{
t
.
Fatal
(
err
)
}
...
...
ops.go
View file @
5b039fd0
...
...
@@ -226,17 +226,17 @@ func DirLookup(d *Directory, pth string) (FSNode, error) {
// TODO: Document this function and link its functionality
// with the republisher.
func
FlushPath
(
ctx
context
.
Context
,
rt
*
Root
,
pth
string
)
error
{
func
FlushPath
(
ctx
context
.
Context
,
rt
*
Root
,
pth
string
)
(
ipld
.
Node
,
error
)
{
nd
,
err
:=
Lookup
(
rt
,
pth
)
if
err
!=
nil
{
return
err
return
nil
,
err
}
err
=
nd
.
Flush
()
if
err
!=
nil
{
return
err
return
nil
,
err
}
rt
.
repub
.
WaitPub
(
ctx
)
return
n
il
return
n
d
.
GetNode
()
}
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