Skip to content

fix(backup): save a single file source under the name given by as-path - #600

Open
AlphaJack wants to merge 1 commit into
rustic-rs:mainfrom
AlphaJack:fix/as-path-file-source
Open

AlphaJack wants to merge 1 commit into
rustic-rs:mainfrom
AlphaJack:fix/as-path-file-source

Conversation

@AlphaJack

Copy link
Copy Markdown

Fixes #599

If as-path is set and the source itself is not a directory (the remainder is empty), rename the node to the last component of as-path. The file then appears at the recorded path, the same way a directory source does. This adds a crate-private Node::set_name, so the public API is unchanged.

If as-path has no file name (e.g. /), nothing changes.

Tests added:

  • test_backup_file_with_as_path: backs up a single file with as-path and dumps the snapshot's recorded path.
  • test_backup_stdin_with_as_path: same for stdin-command.

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.

--as-path with a single file source records a path that doesn't exist in the snapshot

1 participant