From 028c9a53438bf1c4b211d26868a06aa6c6232415 Mon Sep 17 00:00:00 2001
From: "Leo R. Lundgren" <leo@finalresort.org>
Date: Mon, 28 Sep 2020 12:54:13 +0200
Subject: [PATCH] backup: Correct keep policy text

Makes the following corrections to the "Applying Policy:" output:

- keep the last 1 snapshots snapshots => keep 1 latest snapshots
- keep the last 1 snapshots, 3 hourly, 5 yearly snapshots => keep 1 latest, 3 hourly, 5 yearly snapshots
---
 internal/restic/snapshot_policy.go | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/internal/restic/snapshot_policy.go b/internal/restic/snapshot_policy.go
index 08ed843c8..c6427c7c0 100644
--- a/internal/restic/snapshot_policy.go
+++ b/internal/restic/snapshot_policy.go
@@ -25,7 +25,7 @@ type ExpirePolicy struct {
 func (e ExpirePolicy) String() (s string) {
 	var keeps []string
 	if e.Last > 0 {
-		keeps = append(keeps, fmt.Sprintf("%d snapshots", e.Last))
+		keeps = append(keeps, fmt.Sprintf("%d latest", e.Last))
 	}
 	if e.Hourly > 0 {
 		keeps = append(keeps, fmt.Sprintf("%d hourly", e.Hourly))
@@ -44,7 +44,7 @@ func (e ExpirePolicy) String() (s string) {
 	}
 
 	if len(keeps) > 0 {
-		s = fmt.Sprintf("keep the last %s snapshots", strings.Join(keeps, ", "))
+		s = fmt.Sprintf("keep %s snapshots", strings.Join(keeps, ", "))
 	}
 
 	if len(e.Tags) > 0 {