diff --git a/src/cli/backup/exchange.go b/src/cli/backup/exchange.go index e4b8470c7..680d6ed83 100644 --- a/src/cli/backup/exchange.go +++ b/src/cli/backup/exchange.go @@ -2,7 +2,6 @@ package backup import ( "context" - "fmt" "github.com/alcionai/clues" "github.com/pkg/errors" @@ -170,8 +169,6 @@ func createExchangeCmd(cmd *cobra.Command, args []string) error { return Only(ctx, clues.Wrap(err, "Failed to retrieve M365 users")) } - fmt.Printf("\n-----\nINS %+v\n-----\n", ins) - selectorSet := []selectors.Selector{} for _, discSel := range sel.SplitByResourceOwner(ins.IDs()) { diff --git a/src/pkg/backup/details/details.go b/src/pkg/backup/details/details.go index 6c8efbdfa..7cd99a7bd 100644 --- a/src/pkg/backup/details/details.go +++ b/src/pkg/backup/details/details.go @@ -171,7 +171,7 @@ func (b *Builder) Details() *Details { // AddFoldersForItem, and unexport AddFoldersForItem. func FolderEntriesForPath(parent, location *path.Builder) []folderEntry { folders := []folderEntry{} - lfs := locationRefOf(location) + lfs := location for len(parent.Elements()) > 0 { var ( @@ -213,21 +213,6 @@ func FolderEntriesForPath(parent, location *path.Builder) []folderEntry { return folders } -// assumes the pb contains a path like: -// ////... -// and returns a string with only /... -func locationRefOf(pb *path.Builder) *path.Builder { - if pb == nil { - return nil - } - - for i := 0; i < 4; i++ { - pb = pb.PopFront() - } - - return pb -} - // AddFoldersForItem adds entries for the given folders. It skips adding entries that // have been added by previous calls. func (b *Builder) AddFoldersForItem(folders []folderEntry, itemInfo ItemInfo, updated bool) { diff --git a/src/pkg/backup/details/details_test.go b/src/pkg/backup/details/details_test.go index b268e39b8..c3d1a494f 100644 --- a/src/pkg/backup/details/details_test.go +++ b/src/pkg/backup/details/details_test.go @@ -1138,12 +1138,6 @@ func (suite *DetailsUnitSuite) TestFolderEntriesForPath() { parent: basePath, expect: baseFolderEnts, }, - { - name: "base path with location", - parent: basePath, - location: basePath, - expect: baseFolderEnts, - }, { name: "single depth parent only", parent: basePath.Append(fnords...), @@ -1152,7 +1146,7 @@ func (suite *DetailsUnitSuite) TestFolderEntriesForPath() { { name: "single depth with location", parent: basePath.Append(fnords...), - location: basePath.Append(beau...), + location: path.Builder{}.Append(beau...), expect: folderEntriesFor(fnords, beau), }, { @@ -1163,13 +1157,13 @@ func (suite *DetailsUnitSuite) TestFolderEntriesForPath() { { name: "two depth with location", parent: basePath.Append(smarf...), - location: basePath.Append(regard...), + location: path.Builder{}.Append(regard...), expect: folderEntriesFor(smarf, regard), }, { name: "mismatched depth, parent longer", parent: basePath.Append(smarf...), - location: basePath.Append(beau...), + location: path.Builder{}.Append(beau...), expect: folderEntriesFor(smarf, beau), }, // We can't handle this right now. But we don't have any cases