Skip to content

rest: Ignore missing directories#4400

Merged
MichaelEischer merged 3 commits intorestic:masterfrom
MichaelEischer:rest-handle-missing-dirs
Jul 14, 2023
Merged

rest: Ignore missing directories#4400
MichaelEischer merged 3 commits intorestic:masterfrom
MichaelEischer:rest-handle-missing-dirs

Conversation

@MichaelEischer
Copy link
Copy Markdown
Member

@MichaelEischer MichaelEischer commented Jul 7, 2023

What does this PR change? What problem does it solve?

Listing a file type failed for the rest backend if the corresponding folder was missing. See restic/rest-server#235 . Just ignore the 404 error returned in this case, similar to the behavior in other backends. The missing folders will be created when saving files.

Was the change previously discussed in an issue or on the forum?

Fixes restic/rest-server#235

Checklist

  • I have read the contribution guidelines.
  • I have enabled maintainer edits.
  • I have added tests for all code changes.
  • [ ] I have added documentation for relevant changes (in the manual).
  • There's a new file in changelog/unreleased/ that describes the changes for our users (see template).
  • I have run gofmt on the code in all commits.
  • All commit messages are formatted in the same style as the other commits in the repo.
  • I'm done! This pull request is ready for review.

@MichaelEischer MichaelEischer force-pushed the rest-handle-missing-dirs branch from 17a243d to cad06a4 Compare July 8, 2023 22:06
When transferring a repository from S3 to, for example, a local disk
then all empty folders will be missing.

When saving files, the missing intermediate folders are created
automatically. Therefore, missing directories can be ignored by the
`List()` operation.
@MichaelEischer MichaelEischer force-pushed the rest-handle-missing-dirs branch from cad06a4 to 5705326 Compare July 14, 2023 20:39
Copy link
Copy Markdown
Member Author

@MichaelEischer MichaelEischer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migration of already existing repositories leads to 404

1 participant