forked from TrueCloudLab/restic
Merge pull request #2577 from alrs/fix-internal-errs
internal: Fix code and test dropped errors
This commit is contained in:
commit
d8da9c4401
4 changed files with 7 additions and 0 deletions
|
@ -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)
|
sn, err := restic.NewSnapshot(targets, opts.Tags, opts.Hostname, opts.Time)
|
||||||
|
if err != nil {
|
||||||
|
return nil, restic.ID{}, err
|
||||||
|
}
|
||||||
|
|
||||||
sn.Excludes = opts.Excludes
|
sn.Excludes = opts.Excludes
|
||||||
if !opts.ParentSnapshot.IsNull() {
|
if !opts.ParentSnapshot.IsNull() {
|
||||||
id := opts.ParentSnapshot
|
id := opts.ParentSnapshot
|
||||||
|
|
|
@ -60,6 +60,7 @@ func TestLayout(t *testing.T) {
|
||||||
datafiles[fi.Name] = false
|
datafiles[fi.Name] = false
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
|
rtest.OK(t, err)
|
||||||
|
|
||||||
if len(datafiles) == 0 {
|
if len(datafiles) == 0 {
|
||||||
t.Errorf("List() returned zero data files")
|
t.Errorf("List() returned zero data files")
|
||||||
|
|
|
@ -134,6 +134,7 @@ func TestIndexSerialize(t *testing.T) {
|
||||||
id := restic.NewRandomID()
|
id := restic.NewRandomID()
|
||||||
rtest.OK(t, idx.SetID(id))
|
rtest.OK(t, idx.SetID(id))
|
||||||
id2, err := idx.ID()
|
id2, err := idx.ID()
|
||||||
|
rtest.OK(t, err)
|
||||||
rtest.Assert(t, id2.Equal(id),
|
rtest.Assert(t, id2.Equal(id),
|
||||||
"wrong ID returned: want %v, got %v", id, id2)
|
"wrong ID returned: want %v, got %v", id, id2)
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,7 @@ func TestConfig(t *testing.T) {
|
||||||
rtest.OK(t, err)
|
rtest.OK(t, err)
|
||||||
|
|
||||||
_, err = saver(save).SaveJSONUnpacked(restic.ConfigFile, cfg1)
|
_, 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 {
|
load := func(ctx context.Context, tpe restic.FileType, id restic.ID, arg interface{}) error {
|
||||||
rtest.Assert(t, tpe == restic.ConfigFile,
|
rtest.Assert(t, tpe == restic.ConfigFile,
|
||||||
|
|
Loading…
Reference in a new issue