diff --git a/src/cli/restore/sharepoint.go b/src/cli/restore/sharepoint.go index 3fd7c252f..55de9b797 100644 --- a/src/cli/restore/sharepoint.go +++ b/src/cli/restore/sharepoint.go @@ -170,7 +170,7 @@ func restoreSharePointCmd(cmd *cobra.Command, args []string) error { defer utils.CloseRepo(ctx, r) - dest := control.DefaultRestoreDestination(common.SimpleDateTime) + dest := control.DefaultRestoreDestination(common.SimpleDateTimeOneDrive) sel := utils.IncludeSharePointRestoreDataSelectors(opts) utils.FilterSharePointRestoreInfoSelectors(sel, opts) diff --git a/src/internal/connector/onedrive/drivesource_string.go b/src/internal/connector/onedrive/drivesource_string.go new file mode 100644 index 000000000..c746448bc --- /dev/null +++ b/src/internal/connector/onedrive/drivesource_string.go @@ -0,0 +1,25 @@ +// Code generated by "stringer -type=driveSource"; DO NOT EDIT. + +package onedrive + +import "strconv" + +func _() { + // An "invalid array index" compiler error signifies that the constant values have changed. + // Re-run the stringer command to generate them again. + var x [1]struct{} + _ = x[unknownDriveSource-0] + _ = x[OneDriveSource-1] + _ = x[SharePointSource-2] +} + +const _driveSource_name = "unknownDriveSourceOneDriveSourceSharePointSource" + +var _driveSource_index = [...]uint8{0, 18, 32, 48} + +func (i driveSource) String() string { + if i < 0 || i >= driveSource(len(_driveSource_index)-1) { + return "driveSource(" + strconv.FormatInt(int64(i), 10) + ")" + } + return _driveSource_name[_driveSource_index[i]:_driveSource_index[i+1]] +} diff --git a/src/internal/connector/onedrive/restore.go b/src/internal/connector/onedrive/restore.go index ed098ad6a..53c64a999 100644 --- a/src/internal/connector/onedrive/restore.go +++ b/src/internal/connector/onedrive/restore.go @@ -234,7 +234,8 @@ func RestoreCollection( restoreFolderElements, parentPerms, colPerms, - permissionIDMappings) + permissionIDMappings, + ) if err != nil { errUpdater(directory.String(), errors.Wrapf(err, "failed to create folders %v", restoreFolderElements)) return metrics, folderPerms, permissionIDMappings, false diff --git a/src/internal/connector/sharepoint/restore.go b/src/internal/connector/sharepoint/restore.go index 3173d5778..bb257ec6b 100644 --- a/src/internal/connector/sharepoint/restore.go +++ b/src/internal/connector/sharepoint/restore.go @@ -70,7 +70,7 @@ func RestoreCollections( service, dc, map[string][]onedrive.UserPermission{}, // Currently permission data is not stored for sharepoint - onedrive.OneDriveSource, + onedrive.SharePointSource, dest.ContainerName, deets, errUpdater,