-
-
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
feat(command): add force flag for files rm #5555
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -629,6 +629,20 @@ test_files_api() { | |
test_expect_success "repo gc $EXTRA" ' | ||
ipfs repo gc | ||
' | ||
|
||
# test rm | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd like to add a test with an actual corrupted node, which could just be an empty proto-node, but I'm not sure how could we add that to MFS,
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, turn off flush:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OT: What's the difference of adding a file in MFS without flushing? I still don't know how that works (and I'm supposedly the one in charge of reviewing the MFS API 😬) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thinking about this some more, after adding the checks to |
||
|
||
test_expect_success "remove file forcibly" ' | ||
echo "hello world" | ipfs files write --create /forcibly && | ||
ipfs files rm --force /forcibly && | ||
verify_dir_contents / | ||
' | ||
|
||
test_expect_success "remove directory forcibly" ' | ||
ipfs files mkdir /forcibly-dir && | ||
ipfs files rm --force /forcibly-dir && | ||
verify_dir_contents / | ||
' | ||
} | ||
|
||
# test offline and online | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: we can now turn this single-case switch into an
if