From 5904f80cfa077f68422f289e9fdc0007f68b6217 Mon Sep 17 00:00:00 2001 From: kitone Date: Sat, 6 Nov 2021 20:18:51 +0100 Subject: [PATCH] restic cache should display the name of the cache without shortening it in the case of the restic check --- cmd/restic/cmd_cache.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmd/restic/cmd_cache.go b/cmd/restic/cmd_cache.go index 1b36219eb..50a738d5c 100644 --- a/cmd/restic/cmd_cache.go +++ b/cmd/restic/cmd_cache.go @@ -5,6 +5,7 @@ import ( "os" "path/filepath" "sort" + "strings" "time" "github.com/restic/restic/internal/cache" @@ -140,8 +141,13 @@ func runCache(opts CacheOptions, gopts GlobalOptions, args []string) error { size = fmt.Sprintf("%11s", formatBytes(uint64(bytes))) } + name := entry.Name() + if !strings.HasPrefix(name, "restic-check-cache-") { + name = name[:10] + } + tab.AddRow(data{ - entry.Name()[:10], + name, fmt.Sprintf("%d days ago", uint(time.Since(entry.ModTime()).Hours()/24)), old, size,