mirror of
https://github.com/octoleo/restic.git
synced 2024-12-22 02:48:55 +00:00
Merge pull request #2577 from alrs/fix-internal-errs
internal: Fix code and test dropped errors
This commit is contained in:
commit
d8da9c4401
@ -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
|
||||
|
@ -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")
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user