-
-
Notifications
You must be signed in to change notification settings - Fork 62
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
fix: restore path on Windows #631
base: main
Are you sure you want to change the base?
Conversation
Hey -- thanks for the interest in contributing! Making this consistent with the Linux behavior is a goal, appreciate you taking a look at it. I'm seeing a windows test fail here: https://github.com/garethgeorge/backrest/blob/0dd360b4973b9f60ba706f869a1a6eb883713afd/internal/orchestrator/repo/repo_test.go#L136C1-L137C1 A few fixes might be needed for windows -- things that stand out to me is that this code was using path.Dir and path.Base , that might need to change to filepath.Dir and filepath.Base respectively which are the cross platform libraries. There might be other issues with how the command is being crafted on windows, unfortunately it's truncated in the error message so it might need some debugging |
internal/orchestrator/repo/repo.go
Outdated
if runtime.GOOS == "windows" { | ||
opts = append(opts, restic.WithFlags("--include", snapshotPath)) | ||
if dir != "" { |
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.
is this branch now the same as the branch for linux? It may be fine to combine them.
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.
yes, it might be fine to combine them.
Overall looks great, the path normalization makes sense to me. Thanks for digging into this / contributing a fix. |
Fix restore path on Windows, issue #528
Now when you restore a path on Windows, the entire directory tree is not recreated but only the desired path.