-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding directory with ./ leads to unexpected results #5456
Comments
@rob-deutsch Maybe @Stebalien Can I try to solve him? |
@Stebalien Maybe this line should add |
Hey you two! Thanks @rob-deutsch for reporting this and @overbool for diagnosing it, the slash is definetly tripping the command up, I'm not sure if |
I just did some research, and I believe that QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn is the address of an empty directory. I could be biased, because I just spent a few hours looking at it (for unrelated reasons), but I think the issue could be around... go-ipfs/core/coreunix/add.go#L380 I don't know if that code is wrong though. The issue might be further up the pipeline. go-ipfs thinks that the highest-level directory name when i type "./" is ".". I'll await @keks expertise! |
On second thought.... maybe my shell knowledge is incomplete! I just thought I'd try
So what's making a difference is whether I have [edit]: That being said, if |
My approach would be to pull |
@keks Is this what you mean? func appendFile(fpath string, argDef *cmdkit.Argument, recursive, hidden bool) (files.File, error) {
fpath = filepath.Clean(fpath) // clean the path
if fpath == "."{
cwd, err := os.Getwd()
if err != nil {
return nil, err |
@Stebalien I had moved |
I think so, but I'll let @keks take a look. |
Needs tests. |
License: MIT Signed-off-by: Overbool <[email protected]>
test(add): add test for issue \#5456
Version information:
go-ipfs version: 0.4.17-dfd19c470
Repo version: 7
System version: amd64/darwin
Golang version: go1.10.3
Type:
Bug
Description:
Unexpected behaviour when adding a directory using
./
.Expected behaviour when adding a directory is as follows:
Abnormal directory when adding the same directory with
./
:The primary observable problem is that
ls
doesn't list any files, but something deeper has probably gone awry here.The text was updated successfully, but these errors were encountered: