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
Commits
c44191e0
Unverified
Commit
c44191e0
authored
Mar 22, 2018
by
Whyrusleeping
Committed by
GitHub
Mar 22, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4743 from schomatis/fix/unixfs/dagarchive-path
unixfs: clean path in DagArchive
parents
b8e7b632
f710b31f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletion
+10
-1
test/sharness/t0090-get.sh
test/sharness/t0090-get.sh
+8
-0
unixfs/archive/archive.go
unixfs/archive/archive.go
+2
-1
No files found.
test/sharness/t0090-get.sh
View file @
c44191e0
...
...
@@ -104,6 +104,14 @@ test_get_cmd() {
rm -r "$HASH2"
'
# Test issue #4720: problems when path contains a trailing slash.
test_expect_success
"ipfs get with slash (directory)"
'
ipfs get "$HASH2/" &&
test_cmp dir/a "$HASH2"/a &&
test_cmp dir/b/c "$HASH2"/b/c &&
rm -r "$HASH2"
'
test_expect_success
"ipfs get -a -C succeeds (directory)"
'
ipfs get "$HASH2" -a -C >actual
'
...
...
unixfs/archive/archive.go
View file @
c44191e0
...
...
@@ -33,7 +33,8 @@ func (i *identityWriteCloser) Close() error {
// DagArchive is equivalent to `ipfs getdag $hash | maybe_tar | maybe_gzip`
func
DagArchive
(
ctx
context
.
Context
,
nd
ipld
.
Node
,
name
string
,
dag
ipld
.
DAGService
,
archive
bool
,
compression
int
)
(
io
.
Reader
,
error
)
{
_
,
filename
:=
path
.
Split
(
name
)
cleaned
:=
path
.
Clean
(
name
)
_
,
filename
:=
path
.
Split
(
cleaned
)
// need to connect a writer to a reader
piper
,
pipew
:=
io
.
Pipe
()
...
...
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