Merge pull request #2577 from alrs/fix-internal-errs

internal: Fix code and test dropped errors
This commit is contained in:
rawtaz 2020-02-12 23:41:54 +01:00 committed by GitHub
commit d8da9c4401
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 0 deletions

View File

@ -823,6 +823,10 @@ func (arch *Archiver) Snapshot(ctx context.Context, targets []string, opts Snaps
}
sn, err := restic.NewSnapshot(targets, opts.Tags, opts.Hostname, opts.Time)
if err != nil {
return nil, restic.ID{}, err
}
sn.Excludes = opts.Excludes
if !opts.ParentSnapshot.IsNull() {
id := opts.ParentSnapshot

View File

@ -60,6 +60,7 @@ func TestLayout(t *testing.T) {
datafiles[fi.Name] = false
return nil
})
rtest.OK(t, err)
if len(datafiles) == 0 {
t.Errorf("List() returned zero data files")

View File

@ -134,6 +134,7 @@ func TestIndexSerialize(t *testing.T) {
id := restic.NewRandomID()
rtest.OK(t, idx.SetID(id))
id2, err := idx.ID()
rtest.OK(t, err)
rtest.Assert(t, id2.Equal(id),
"wrong ID returned: want %v, got %v", id, id2)

View File

@ -36,6 +36,7 @@ func TestConfig(t *testing.T) {
rtest.OK(t, err)
_, err = saver(save).SaveJSONUnpacked(restic.ConfigFile, cfg1)
rtest.OK(t, err)
load := func(ctx context.Context, tpe restic.FileType, id restic.ID, arg interface{}) error {
rtest.Assert(t, tpe == restic.ConfigFile,