Skip to content

Commit

Permalink
Merge pull request #442 from PlakarKorp/op/ls
Browse files Browse the repository at this point in the history
improve ls snapshotID
  • Loading branch information
poolpOrg authored Feb 7, 2025
2 parents c688d6f + cde3a46 commit cc9cbc4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 5 additions & 1 deletion cmd/plakar/subcommands/ls/ls.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,11 @@ func list_snapshots(ctx *appcontext.AppContext, repo *repository.Repository, use

func list_snapshot(ctx *appcontext.AppContext, repo *repository.Repository, snapshotPath string, recursive bool) error {
prefix, pathname := utils.ParseSnapshotID(snapshotPath)
pathname = path.Clean(pathname)
if pathname == "" {
pathname = "/"
} else {
pathname = path.Clean(pathname)
}

snap, err := utils.OpenSnapshotByPrefix(repo, prefix)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion objects/fileinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func (f FileInfo) Nlink() uint16 {
}

func (f FileInfo) Sys() any {
return nil
return f
}

func (f FileInfo) Username() string {
Expand Down
4 changes: 0 additions & 4 deletions objects/fileinfo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,4 @@ func TestFileInfoFromStat(t *testing.T) {
if fileInfo.Groupname() != groupname {
t.Errorf("expected Groupname %v, got %v", groupname, fileInfo.Lgroupname)
}

if fileInfo.Sys() != nil {
t.Errorf("expected nil, got %v", fileInfo.Sys())
}
}

0 comments on commit cc9cbc4

Please sign in to comment.