new sub-option for backup: time

New option to specify the timestamp for a backup
This commit is contained in:
Tobias Klein
2017-08-29 18:29:46 +02:00
parent 5c75a98053
commit 43ff971dfd
6 changed files with 19 additions and 8 deletions

View File

@@ -3,6 +3,7 @@ package archiver
import (
"context"
"testing"
"time"
"github.com/restic/restic/internal/restic"
)
@@ -10,7 +11,7 @@ import (
// TestSnapshot creates a new snapshot of path.
func TestSnapshot(t testing.TB, repo restic.Repository, path string, parent *restic.ID) *restic.Snapshot {
arch := New(repo)
sn, _, err := arch.Snapshot(context.TODO(), nil, []string{path}, []string{"test"}, "localhost", parent)
sn, _, err := arch.Snapshot(context.TODO(), nil, []string{path}, []string{"test"}, "localhost", parent, time.Now())
if err != nil {
t.Fatal(err)
}