repo
stringlengths
6
47
file_url
stringlengths
77
269
file_path
stringlengths
5
186
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-07 08:35:43
2026-01-07 08:55:24
truncated
bool
2 classes
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/restorer/fileswriter_windows_test.go
internal/restorer/fileswriter_windows_test.go
package restorer import "syscall" func notEmptyDirError() error { return syscall.ERROR_DIR_NOT_EMPTY }
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/restorer/restorer.go
internal/restorer/restorer.go
package restorer import ( "context" "fmt" "io" "os" "path/filepath" "sync/atomic" "github.com/restic/restic/internal/data" "github.com/restic/restic/internal/debug" "github.com/restic/restic/internal/errors" "github.com/restic/restic/internal/fs" "github.com/restic/restic/internal/restic" "github.com/rest...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/restorer/restorer_windows_test.go
internal/restorer/restorer_windows_test.go
//go:build windows package restorer import ( "context" "encoding/json" "math" "os" "path" "path/filepath" "syscall" "testing" "time" "unsafe" "github.com/restic/restic/internal/data" "github.com/restic/restic/internal/debug" "github.com/restic/restic/internal/errors" "github.com/restic/restic/internal/...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/restorer/filerestorer.go
internal/restorer/filerestorer.go
package restorer import ( "context" "fmt" "path/filepath" "sync" "golang.org/x/sync/errgroup" "github.com/restic/restic/internal/debug" "github.com/restic/restic/internal/errors" "github.com/restic/restic/internal/feature" "github.com/restic/restic/internal/repository" "github.com/restic/restic/internal/re...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/restorer/hardlinks_index_test.go
internal/restorer/hardlinks_index_test.go
package restorer_test import ( "testing" "github.com/restic/restic/internal/restorer" rtest "github.com/restic/restic/internal/test" ) // TestHardLinks contains various tests for HardlinkIndex. func TestHardLinks(t *testing.T) { idx := restorer.NewHardlinkIndex[string]() idx.Add(1, 2, "inode1-file1-on-device2...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/restorer/doc.go
internal/restorer/doc.go
// Package restorer contains code to restore data from a repository. // // The Restorer tries to keep the number of backend requests minimal. It does // this by downloading all required blobs of a pack file with a single backend // request and avoiding repeated downloads of the same pack. In addition, // several pack f...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/restorer/restorer_unix.go
internal/restorer/restorer_unix.go
//go:build !windows package restorer // toComparableFilename returns a filename suitable for equality checks. On Windows, it returns the // uppercase version of the string. On all other systems, it returns the unmodified filename. func toComparableFilename(path string) string { return path }
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/restorer/sparsewrite.go
internal/restorer/sparsewrite.go
package restorer import ( "github.com/restic/restic/internal/restic" ) // WriteAt writes p to f.File at offset. It tries to do a sparse write // and updates f.size. func (f *partialFile) WriteAt(p []byte, offset int64) (n int, err error) { if !f.sparse { return f.File.WriteAt(p, offset) } n = len(p) // Skip ...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/restorer/restorer_windows.go
internal/restorer/restorer_windows.go
//go:build windows package restorer import "strings" // toComparableFilename returns a filename suitable for equality checks. On Windows, it returns the // uppercase version of the string. On all other systems, it returns the unmodified filename. func toComparableFilename(path string) string { // apparently NTFS in...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/textfile/read_test.go
internal/textfile/read_test.go
package textfile import ( "bytes" "encoding/hex" "os" "testing" ) // writeTempfile writes data to a new temporary file and returns its name // and a callback that removes it. func writeTempfile(t testing.TB, data []byte) (string, func()) { t.Helper() f, err := os.CreateTemp("", "restic-test-textfile-read-") i...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/textfile/read.go
internal/textfile/read.go
// Package textfile allows reading files that contain text. It automatically // detects and converts several encodings and removes Byte Order Marks (BOM). package textfile import ( "bytes" "os" "golang.org/x/text/encoding/unicode" ) // All supported BOMs (Byte Order Marks) var ( bomUTF8 = []byte{0xe...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/filter/exclude_test.go
internal/filter/exclude_test.go
package filter import ( "testing" ) func TestRejectByPattern(t *testing.T) { var tests = []struct { filename string reject bool }{ {filename: "/home/user/foo.go", reject: true}, {filename: "/home/user/foo.c", reject: false}, {filename: "/home/user/foobar", reject: false}, {filename: "/home/user/fooba...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/filter/exclude.go
internal/filter/exclude.go
package filter import ( "bufio" "bytes" "fmt" "os" "strings" "github.com/restic/restic/internal/debug" "github.com/restic/restic/internal/errors" "github.com/restic/restic/internal/textfile" "github.com/spf13/pflag" ) // RejectByNameFunc is a function that takes a filename of a // file that would be include...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/filter/filter.go
internal/filter/filter.go
package filter import ( "path/filepath" "strings" "github.com/restic/restic/internal/errors" ) // ErrBadString is returned when Match is called with the empty string as the // second argument. var ErrBadString = errors.New("filter.Match: string is empty") type patternPart struct { pattern string // First is "/...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/filter/filter_test.go
internal/filter/filter_test.go
package filter_test import ( "bufio" "compress/bzip2" "fmt" "os" "path/filepath" "strings" "testing" "github.com/restic/restic/internal/filter" ) var matchTests = []struct { pattern string path string match bool }{ {"", "", true}, {"", "foo", true}, {"", "/x/y/z/foo", true}, {"*.go", "/foo/bar/te...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/filter/include.go
internal/filter/include.go
package filter import ( "strings" "github.com/restic/restic/internal/errors" "github.com/spf13/pflag" ) // IncludeByNameFunc is a function that takes a filename that should be included // in the restore process and returns whether it should be included. type IncludeByNameFunc func(item string) (matched bool, chil...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/filter/include_test.go
internal/filter/include_test.go
package filter import ( "testing" ) func TestIncludeByPattern(t *testing.T) { var tests = []struct { filename string include bool }{ {filename: "/home/user/foo.go", include: true}, {filename: "/home/user/foo.c", include: false}, {filename: "/home/user/foobar", include: false}, {filename: "/home/user/f...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/filter/doc.go
internal/filter/doc.go
// Package filter implements filters for files similar to filepath.Glob, but // in contrast to filepath.Glob a pattern may specify directories. // // For a list of valid patterns please see the documentation on filepath.Glob. package filter
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/filter/filter_patterns_test.go
internal/filter/filter_patterns_test.go
package filter_test import ( "testing" "github.com/restic/restic/internal/filter" rtest "github.com/restic/restic/internal/test" ) func TestValidPatterns(t *testing.T) { // Test invalid patterns are detected and returned t.Run("detect-invalid-patterns", func(t *testing.T) { err := filter.ValidatePatterns([]st...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/global/global_debug.go
internal/global/global_debug.go
//go:build debug || profile package global import ( "fmt" "io" "net/http" _ "net/http/pprof" "github.com/restic/restic/internal/errors" "github.com/restic/restic/internal/repository" "github.com/spf13/cobra" "github.com/spf13/pflag" "github.com/pkg/profile" ) func RegisterProfiling(cmd *cobra.Command, std...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/global/secondary_repo.go
internal/global/secondary_repo.go
package global import ( "context" "os" "github.com/restic/restic/internal/errors" "github.com/spf13/pflag" ) type SecondaryRepoOptions struct { Password string // from-repo options Repo string RepositoryFile string PasswordFile string PasswordCommand string KeyHint st...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/global/global_release.go
internal/global/global_release.go
//go:build !debug && !profile package global import ( "io" "github.com/spf13/cobra" ) func RegisterProfiling(_ *cobra.Command, _ io.Writer) { // No profiling in release mode }
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/global/secondary_repo_test.go
internal/global/secondary_repo_test.go
package global import ( "context" "os" "path/filepath" "testing" rtest "github.com/restic/restic/internal/test" ) // TestFillSecondaryGlobalOpts tests valid and invalid data on fillSecondaryGlobalOpts-function func TestFillSecondaryGlobalOpts(t *testing.T) { //secondaryRepoTestCase defines a struct for test ca...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/global/global_test.go
internal/global/global_test.go
package global import ( "context" "os" "path/filepath" "strings" "testing" rtest "github.com/restic/restic/internal/test" ) func TestReadRepo(t *testing.T) { tempDir := rtest.TempDir(t) // test --repo option var gopts Options gopts.Repo = tempDir repo, err := readRepo(gopts) rtest.OK(t, err) rtest.Equa...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/global/global.go
internal/global/global.go
package global import ( "context" "fmt" "net/http" "os" "os/exec" "path/filepath" "strconv" "strings" "time" "github.com/restic/chunker" "github.com/restic/restic/internal/backend" "github.com/restic/restic/internal/backend/cache" "github.com/restic/restic/internal/backend/limiter" "github.com/restic/re...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/options/secret_string.go
internal/options/secret_string.go
package options type SecretString struct { s *string } func NewSecretString(s string) SecretString { return SecretString{s: &s} } func (s SecretString) GoString() string { return `"` + s.String() + `"` } func (s SecretString) String() string { if s.s == nil || len(*s.s) == 0 { return `` } return `**redacted...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/options/options_test.go
internal/options/options_test.go
package options import ( "fmt" "reflect" "regexp" "testing" "time" ) var optsTests = []struct { input []string output Options }{ { []string{"foo=bar", "bar=baz ", "k="}, Options{ "foo": "bar", "bar": "baz", "k": "", }, }, { []string{"Foo=23", "baR", "k=thing with spaces"}, Options{ ...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/options/options.go
internal/options/options.go
package options import ( "reflect" "sort" "strconv" "strings" "time" "github.com/restic/restic/internal/errors" ) // Options holds options in the form key=value. type Options map[string]string var opts []Help // Register allows registering options so that they can be listed with List. func Register(ns string...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/options/secret_string_test.go
internal/options/secret_string_test.go
package options_test import ( "fmt" "strings" "testing" "github.com/restic/restic/internal/options" "github.com/restic/restic/internal/test" ) type secretTest struct { str options.SecretString } func assertNotIn(t *testing.T, str string, substr string) { if strings.Contains(str, substr) { t.Fatalf("'%s' sh...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/checker/checker.go
internal/checker/checker.go
package checker import ( "context" "fmt" "runtime" "sync" "github.com/restic/restic/internal/data" "github.com/restic/restic/internal/debug" "github.com/restic/restic/internal/errors" "github.com/restic/restic/internal/repository" "github.com/restic/restic/internal/restic" "github.com/restic/restic/internal...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/checker/checker_test.go
internal/checker/checker_test.go
package checker_test import ( "context" "io" "math/rand" "os" "path/filepath" "sort" "strconv" "strings" "sync" "testing" "time" "github.com/restic/restic/internal/archiver" "github.com/restic/restic/internal/backend" "github.com/restic/restic/internal/checker" "github.com/restic/restic/internal/data" ...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/checker/testing.go
internal/checker/testing.go
package checker import ( "context" "testing" "github.com/restic/restic/internal/data" "github.com/restic/restic/internal/restic" ) // TestCheckRepo runs the checker on repo. func TestCheckRepo(t testing.TB, repo checkerRepository) { chkr := New(repo, true) hints, errs := chkr.LoadIndex(context.TODO(), nil) i...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/errors/errors.go
internal/errors/errors.go
package errors import ( stderrors "errors" "github.com/pkg/errors" ) // New creates a new error based on message. Wrapped so that this package does // not appear in the stack trace. var New = errors.New // Errorf creates an error based on a format string and values. Wrapped so that // this package does not appear...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/errors/fatal.go
internal/errors/fatal.go
package errors import ( "errors" "fmt" ) // fatalError is an error that should be printed to the user, then the program // should exit with an error code. type fatalError struct { msg string err error // Underlying error } func (e *fatalError) Error() string { return e.msg } func (e *fatalError) Unwrap() error...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/errors/fatal_test.go
internal/errors/fatal_test.go
package errors_test import ( "testing" "github.com/restic/restic/internal/errors" ) func TestFatal(t *testing.T) { for _, v := range []struct { err error expected bool }{ {errors.Fatal("broken"), true}, {errors.Fatalf("broken %d", 42), true}, {errors.New("error"), false}, } { if errors.IsFatal(...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/errors/doc.go
internal/errors/doc.go
// Package errors provides custom error types used within restic. package errors
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/restic/json.go
internal/restic/json.go
package restic import ( "context" "encoding/json" "github.com/restic/restic/internal/debug" "github.com/restic/restic/internal/errors" ) // LoadJSONUnpacked decrypts the data and afterwards calls json.Unmarshal on // the item. func LoadJSONUnpacked(ctx context.Context, repo LoaderUnpacked, t FileType, id ID, ite...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/restic/lock_windows.go
internal/restic/lock_windows.go
package restic import ( "os" "os/user" "github.com/restic/restic/internal/debug" ) // UidGidInt always returns 0 on Windows, since uid isn't numbers func UidGidInt(_ *user.User) (uid, gid uint32, err error) { return 0, 0, nil } // checkProcess will check if the process retaining the lock exists. // Returns true...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/restic/backend_find.go
internal/restic/backend_find.go
package restic import ( "context" "fmt" ) // A MultipleIDMatchesError is returned by Find() when multiple IDs with a // given prefix are found. type MultipleIDMatchesError struct{ prefix string } func (e *MultipleIDMatchesError) Error() string { return fmt.Sprintf("multiple IDs with prefix %q found", e.prefix) } ...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/restic/id_int_test.go
internal/restic/id_int_test.go
package restic import "testing" func TestIDMethods(t *testing.T) { var id ID if id.Str() != "[null]" { t.Errorf("ID.Str() returned wrong value, want %v, got %v", "[null]", id.Str()) } var pid *ID if pid.Str() != "[nil]" { t.Errorf("ID.Str() returned wrong value, want %v, got %v", "[nil]", pid.Str()) } }
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/restic/idset.go
internal/restic/idset.go
package restic import ( "maps" "sort" ) // IDSet is a set of IDs. type IDSet map[ID]struct{} // NewIDSet returns a new IDSet, populated with ids. func NewIDSet(ids ...ID) IDSet { m := make(IDSet) for _, id := range ids { m[id] = struct{}{} } return m } // Has returns true iff id is contained in the set. fu...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/restic/zeroprefix.go
internal/restic/zeroprefix.go
package restic import "bytes" // ZeroPrefixLen returns the length of the longest all-zero prefix of p. func ZeroPrefixLen(p []byte) (n int) { // First skip 1kB-sized blocks, for speed. var zeros [1024]byte for len(p) >= len(zeros) && bytes.Equal(p[:len(zeros)], zeros[:]) { p = p[len(zeros):] n += len(zeros) ...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/restic/lock_unix.go
internal/restic/lock_unix.go
//go:build !windows package restic import ( "os" "os/user" "strconv" "syscall" "github.com/restic/restic/internal/debug" "github.com/restic/restic/internal/errors" ) // UidGidInt returns uid, gid of the user as a number. // //nolint:revive // captialization is correct as is func UidGidInt(u *user.User) (uid, ...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/restic/id_test.go
internal/restic/id_test.go
package restic import ( "reflect" "testing" ) var TestStrings = []struct { id string data string }{ {"c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2", "foobar"}, {"248d6a61d20638b8e5c026930c3e6039a33ce45964ff2167f6ecedd419db06c1", "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"}, ...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/restic/idset_test.go
internal/restic/idset_test.go
package restic import ( "testing" rtest "github.com/restic/restic/internal/test" ) var idsetTests = []struct { id ID seen bool }{ {TestParseID("7bb086db0d06285d831485da8031281e28336a56baa313539eaea1c73a2a1a40"), false}, {TestParseID("1285b30394f3b74693cc29a758d9624996ae643157776fce8154aabd2f01515f"), false},...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/restic/config.go
internal/restic/config.go
package restic import ( "context" "sync" "testing" "github.com/restic/restic/internal/errors" "github.com/restic/restic/internal/debug" "github.com/restic/chunker" ) // Config contains the configuration for a repository. type Config struct { Version uint `json:"version"` ID ...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/restic/lock.go
internal/restic/lock.go
package restic import ( "context" "fmt" "os" "os/signal" "os/user" "sync" "syscall" "testing" "time" "github.com/restic/restic/internal/errors" "github.com/restic/restic/internal/debug" ) // UnlockCancelDelay bounds the duration how long lock cleanup operations will wait // if the passed in context was c...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/restic/id.go
internal/restic/id.go
package restic import ( "crypto/rand" "crypto/sha256" "encoding/hex" "fmt" "io" ) // Hash returns the ID for data. func Hash(data []byte) ID { return sha256.Sum256(data) } // idSize contains the size of an ID, in bytes. const idSize = sha256.Size // ID references content within a repository. type ID [idSize]b...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/restic/parallel_test.go
internal/restic/parallel_test.go
package restic import ( "context" "sync" "testing" "time" "github.com/restic/restic/internal/errors" "github.com/restic/restic/internal/ui/progress" ) type mockRemoverUnpacked struct { removeUnpacked func(ctx context.Context, t FileType, id ID) error } func (m *mockRemoverUnpacked) Connections() uint { retu...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/restic/parallel.go
internal/restic/parallel.go
package restic import ( "context" "github.com/restic/restic/internal/debug" "github.com/restic/restic/internal/ui/progress" "golang.org/x/sync/errgroup" ) func ParallelList(ctx context.Context, r Lister, t FileType, parallelism uint, fn func(context.Context, ID, int64) error) error { type FileIDInfo struct { ...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/restic/ids_test.go
internal/restic/ids_test.go
package restic import ( "testing" rtest "github.com/restic/restic/internal/test" ) func TestIDsString(t *testing.T) { ids := IDs{ TestParseID("7bb086db0d06285d831485da8031281e28336a56baa313539eaea1c73a2a1a40"), TestParseID("1285b30394f3b74693cc29a758d9624996ae643157776fce8154aabd2f01515f"), TestParseID("7bb...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/restic/lock_test.go
internal/restic/lock_test.go
package restic_test import ( "context" "fmt" "io" "os" "testing" "time" "github.com/restic/restic/internal/backend" "github.com/restic/restic/internal/backend/mem" "github.com/restic/restic/internal/repository" "github.com/restic/restic/internal/restic" rtest "github.com/restic/restic/internal/test" ) fun...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/restic/backend_find_test.go
internal/restic/backend_find_test.go
package restic_test import ( "context" "strings" "testing" "github.com/restic/restic/internal/restic" ) var samples = restic.IDs{ restic.TestParseID("20bdc1402a6fc9b633aaffffffffffffffffffffffffffffffffffffffffffff"), restic.TestParseID("20bdc1402a6fc9b633ccd578c4a92d0f4ef1a457fa2e16c596bc73fb409d6cc0"), rest...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/restic/config_test.go
internal/restic/config_test.go
package restic_test import ( "context" "testing" "github.com/restic/restic/internal/restic" rtest "github.com/restic/restic/internal/test" ) type saver struct { fn func(restic.FileType, []byte) (restic.ID, error) } func (s saver) SaveUnpacked(_ context.Context, t restic.FileType, buf []byte) (restic.ID, error)...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/restic/zeroprefix_test.go
internal/restic/zeroprefix_test.go
package restic_test import ( "math/rand" "testing" "github.com/restic/restic/internal/restic" "github.com/restic/restic/internal/test" ) func TestZeroPrefixLen(t *testing.T) { var buf [2048]byte // test zero prefixes of various lengths for i := len(buf) - 1; i >= 0; i-- { buf[i] = 42 skipped := restic.Ze...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/restic/blob_set_test.go
internal/restic/blob_set_test.go
package restic import ( "math/rand" "regexp" "testing" rtest "github.com/restic/restic/internal/test" ) func TestBlobSetString(t *testing.T) { random := rand.New(rand.NewSource(42)) s := NewBlobSet() rtest.Equals(t, "{}", s.String()) id, _ := ParseID( "111111111111111111111111111111111111111111111111111...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/restic/blob_test.go
internal/restic/blob_test.go
package restic import ( "encoding/json" "testing" ) var blobTypeJSON = []struct { t BlobType res string }{ {DataBlob, `"data"`}, {TreeBlob, `"tree"`}, } func TestBlobTypeJSON(t *testing.T) { for _, test := range blobTypeJSON { // test serialize buf, err := json.Marshal(test.t) if err != nil { t.Err...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/restic/lister_test.go
internal/restic/lister_test.go
package restic_test import ( "context" "fmt" "testing" "github.com/restic/restic/internal/backend" "github.com/restic/restic/internal/restic" rtest "github.com/restic/restic/internal/test" ) type ListHelper struct { ListFn func(ctx context.Context, t restic.FileType, fn func(restic.ID, int64) error) error } ...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/restic/lister.go
internal/restic/lister.go
package restic import ( "context" "fmt" ) type fileInfo struct { id ID size int64 } type memorizedLister struct { fileInfos []fileInfo tpe FileType } func (m *memorizedLister) List(ctx context.Context, t FileType, fn func(ID, int64) error) error { if t != m.tpe { return fmt.Errorf("filetype mismatc...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/restic/testing.go
internal/restic/testing.go
package restic import ( "fmt" ) // TestParseID parses s as a ID and panics if that fails. func TestParseID(s string) ID { id, err := ParseID(s) if err != nil { panic(fmt.Sprintf("unable to parse string %q as ID: %v", s, err)) } return id } // TestParseHandle parses s as a ID, panics if that fails and creates...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/restic/repository.go
internal/restic/repository.go
package restic import ( "context" "iter" "github.com/restic/restic/internal/backend" "github.com/restic/restic/internal/crypto" "github.com/restic/restic/internal/errors" "github.com/restic/restic/internal/ui/progress" ) // ErrInvalidData is used to report that a file is corrupted var ErrInvalidData = errors.N...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/restic/doc.go
internal/restic/doc.go
// Package restic is the top level package for the restic backup program, // please see https://github.com/restic/restic for more information. // // This package exposes the main objects that are handled in restic. package restic
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/restic/blob_set.go
internal/restic/blob_set.go
package restic import ( "fmt" "sort" "strings" ) // BlobSet is a set of blobs. type BlobSet map[BlobHandle]struct{} // NewBlobSet returns a new BlobSet, populated with ids. func NewBlobSet(handles ...BlobHandle) BlobSet { m := make(BlobSet) for _, h := range handles { m[h] = struct{}{} } return m } // Has...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/restic/ids.go
internal/restic/ids.go
package restic import ( "encoding/hex" "strings" ) // IDs is a slice of IDs that implements sort.Interface and fmt.Stringer. type IDs []ID func (ids IDs) Len() int { return len(ids) } func (ids IDs) Less(i, j int) bool { return string(ids[i][:]) < string(ids[j][:]) } func (ids IDs) Swap(i, j int) { ids[i], id...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/restic/blob.go
internal/restic/blob.go
package restic import ( "fmt" "github.com/restic/restic/internal/crypto" "github.com/restic/restic/internal/errors" ) // Blob is one part of a file or a tree. type Blob struct { BlobHandle Length uint Offset uint UncompressedLength uint } func (b Blob) String() string { return fmt.Sp...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/test/vars.go
internal/test/vars.go
package test import ( "fmt" "os" "strings" "testing" ) var ( TestPassword = getStringVar("RESTIC_TEST_PASSWORD", "geheim") TestCleanupTempDirs = getBoolVar("RESTIC_TEST_CLEANUP", true) TestTempDir = getStringVar("RESTIC_TEST_TMPDIR", "") RunIntegrationTest = get...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/test/doc.go
internal/test/doc.go
// Package test provides helper functions for writing tests for restic. package test
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/test/helpers.go
internal/test/helpers.go
package test import ( "compress/bzip2" "compress/gzip" "fmt" "io" "math/rand" "os" "os/exec" "path/filepath" "reflect" "testing" "github.com/restic/restic/internal/errors" ) // Assert fails the test if the condition is false. func Assert(tb testing.TB, condition bool, msg string, v ...interface{}) { tb.H...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/bloblru/cache.go
internal/bloblru/cache.go
package bloblru import ( "sync" "github.com/restic/restic/internal/debug" "github.com/restic/restic/internal/restic" "github.com/hashicorp/golang-lru/v2/simplelru" ) // Crude estimate of the overhead per blob: a SHA-256, a linked list node // and some pointers. See comment in Cache.add. const overhead = len(res...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/bloblru/cache_test.go
internal/bloblru/cache_test.go
package bloblru import ( "context" "fmt" "math/rand" "testing" "github.com/restic/restic/internal/restic" rtest "github.com/restic/restic/internal/test" "golang.org/x/sync/errgroup" ) func TestCache(t *testing.T) { var id1, id2, id3 restic.ID id1[0] = 1 id2[0] = 2 id3[0] = 3 const ( kiB = 1 << 1...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/archiver/archiver.go
internal/archiver/archiver.go
package archiver import ( "context" "fmt" "os" "path" "runtime" "sort" "strings" "sync" "time" "github.com/restic/restic/internal/data" "github.com/restic/restic/internal/debug" "github.com/restic/restic/internal/errors" "github.com/restic/restic/internal/feature" "github.com/restic/restic/internal/fs" ...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/archiver/exclude_test.go
internal/archiver/exclude_test.go
package archiver import ( "os" "path/filepath" "testing" "github.com/restic/restic/internal/fs" "github.com/restic/restic/internal/test" ) func TestIsExcludedByFile(t *testing.T) { const ( tagFilename = "CACHEDIR.TAG" header = "Signature: 8a477f597d28d172789f06886806bc55" ) tests := []struct { nam...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/archiver/tree.go
internal/archiver/tree.go
package archiver import ( "fmt" "sort" "github.com/restic/restic/internal/debug" "github.com/restic/restic/internal/errors" "github.com/restic/restic/internal/fs" ) // tree recursively defines how a snapshot should look like when // archived. // // When `Path` is set, this is a leaf node and the contents of `Pa...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/archiver/exclude.go
internal/archiver/exclude.go
package archiver import ( "bytes" "fmt" "io" "os" "runtime" "strings" "sync" "github.com/restic/restic/internal/debug" "github.com/restic/restic/internal/errors" "github.com/restic/restic/internal/fs" ) // RejectByNameFunc is a function that takes a filename of a // file that would be included in the backu...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/archiver/file_saver_test.go
internal/archiver/file_saver_test.go
package archiver import ( "context" "fmt" "os" "path/filepath" "runtime" "testing" "github.com/restic/chunker" "github.com/restic/restic/internal/data" "github.com/restic/restic/internal/fs" "github.com/restic/restic/internal/test" "golang.org/x/sync/errgroup" ) func createTestFiles(t testing.TB, num int)...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/archiver/archiver_unix_test.go
internal/archiver/archiver_unix_test.go
//go:build !windows package archiver import ( "testing" "github.com/restic/restic/internal/data" "github.com/restic/restic/internal/feature" "github.com/restic/restic/internal/fs" rtest "github.com/restic/restic/internal/test" ) func statAndSnapshot(t *testing.T, repo archiverRepo, name string) (*data.Node, *d...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/archiver/scanner_test.go
internal/archiver/scanner_test.go
package archiver import ( "context" "os" "path/filepath" "runtime" "testing" "github.com/google/go-cmp/cmp" "github.com/restic/restic/internal/fs" rtest "github.com/restic/restic/internal/test" ) func TestScanner(t *testing.T) { var tests = []struct { name string src TestDir want map[string]ScanSt...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/archiver/file_saver.go
internal/archiver/file_saver.go
package archiver import ( "context" "fmt" "io" "sync" "github.com/restic/chunker" "github.com/restic/restic/internal/data" "github.com/restic/restic/internal/debug" "github.com/restic/restic/internal/errors" "github.com/restic/restic/internal/fs" "github.com/restic/restic/internal/restic" "golang.org/x/syn...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/archiver/archiver_test.go
internal/archiver/archiver_test.go
package archiver import ( "bytes" "context" "fmt" "io" "os" "path/filepath" "runtime" "strings" "sync" "sync/atomic" "syscall" "testing" "time" "github.com/google/go-cmp/cmp" "github.com/restic/restic/internal/backend" "github.com/restic/restic/internal/backend/mem" "github.com/restic/restic/internal...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
true
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/archiver/buffer.go
internal/archiver/buffer.go
package archiver import "sync" // buffer is a reusable buffer. After the buffer has been used, Release should // be called so the underlying slice is put back into the pool. type buffer struct { Data []byte pool *bufferPool } // Release puts the buffer back into the pool it came from. func (b *buffer) Release() { ...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/archiver/testing_test.go
internal/archiver/testing_test.go
package archiver import ( "context" "fmt" "os" "path/filepath" "testing" "time" "github.com/google/go-cmp/cmp" "github.com/restic/restic/internal/fs" "github.com/restic/restic/internal/repository" rtest "github.com/restic/restic/internal/test" ) // MockT passes through all logging functions from T, but cat...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/archiver/buffer_test.go
internal/archiver/buffer_test.go
package archiver import ( "testing" ) func TestBufferPoolReuse(t *testing.T) { success := false // retries to avoid flakiness. The test can fail depending on the GC. for i := 0; i < 100; i++ { // Test that buffers are actually reused from the pool pool := newBufferPool(1024) // Get a buffer and modify it ...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/archiver/tree_saver.go
internal/archiver/tree_saver.go
package archiver import ( "context" "errors" "github.com/restic/restic/internal/data" "github.com/restic/restic/internal/debug" "github.com/restic/restic/internal/restic" "golang.org/x/sync/errgroup" ) // treeSaver concurrently saves incoming trees to the repo. type treeSaver struct { uploader restic.BlobSave...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/archiver/scanner.go
internal/archiver/scanner.go
package archiver import ( "context" "sort" "github.com/restic/restic/internal/debug" "github.com/restic/restic/internal/fs" ) // Scanner traverses the targets and calls the function Result with cumulated // stats concerning the files and folders found. Select is used to decide which // items should be included....
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/archiver/tree_saver_test.go
internal/archiver/tree_saver_test.go
package archiver import ( "context" "fmt" "runtime" "sync" "testing" "github.com/restic/restic/internal/data" "github.com/restic/restic/internal/errors" "github.com/restic/restic/internal/restic" "github.com/restic/restic/internal/test" "golang.org/x/sync/errgroup" ) type mockSaver struct { saved map[stri...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/archiver/testing.go
internal/archiver/testing.go
package archiver import ( "context" "os" "path" "path/filepath" "runtime" "sort" "strings" "testing" "time" "github.com/restic/restic/internal/data" "github.com/restic/restic/internal/debug" "github.com/restic/restic/internal/fs" "github.com/restic/restic/internal/restic" ) // TestSnapshot creates a new...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/archiver/doc.go
internal/archiver/doc.go
// Package archiver contains the code which reads files, splits them into // chunks and saves the data to the repository. package archiver
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/archiver/tree_test.go
internal/archiver/tree_test.go
package archiver import ( "fmt" "path/filepath" "runtime" "testing" "github.com/google/go-cmp/cmp" "github.com/restic/restic/internal/fs" rtest "github.com/restic/restic/internal/test" ) // debug.Log requires Tree.String. var _ fmt.Stringer = tree{} func TestPathComponents(t *testing.T) { var tests = []stru...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/repository/repository_internal_test.go
internal/repository/repository_internal_test.go
package repository import ( "bytes" "context" "encoding/json" "io" "math/rand" "sort" "strings" "testing" "github.com/cenkalti/backoff/v4" "github.com/google/go-cmp/cmp" "github.com/klauspost/compress/zstd" "github.com/restic/restic/internal/backend" "github.com/restic/restic/internal/crypto" "github.co...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/repository/raw_test.go
internal/repository/raw_test.go
package repository_test import ( "bytes" "context" "io" "testing" "github.com/restic/restic/internal/backend" "github.com/restic/restic/internal/backend/cache" "github.com/restic/restic/internal/backend/mem" "github.com/restic/restic/internal/backend/mock" "github.com/restic/restic/internal/errors" "github....
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/repository/repair_index.go
internal/repository/repair_index.go
package repository import ( "context" "github.com/restic/restic/internal/repository/index" "github.com/restic/restic/internal/repository/pack" "github.com/restic/restic/internal/restic" "github.com/restic/restic/internal/ui/progress" ) type RepairIndexOptions struct { ReadAllPacks bool } func RepairIndex(ctx ...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/repository/upgrade_repo_test.go
internal/repository/upgrade_repo_test.go
package repository import ( "context" "os" "path/filepath" "sync" "testing" "github.com/restic/restic/internal/backend" "github.com/restic/restic/internal/errors" rtest "github.com/restic/restic/internal/test" ) func TestUpgradeRepoV2(t *testing.T) { repo, _, _ := TestRepositoryWithVersion(t, 1) if repo.Co...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/repository/packer_manager.go
internal/repository/packer_manager.go
package repository import ( "bufio" "context" "crypto/rand" "crypto/sha256" "io" "math/big" "os" "sync" "github.com/restic/restic/internal/backend" "github.com/restic/restic/internal/errors" "github.com/restic/restic/internal/repository/hashing" "github.com/restic/restic/internal/restic" "github.com/res...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/repository/checker.go
internal/repository/checker.go
package repository import ( "bufio" "context" "fmt" "github.com/klauspost/compress/zstd" "github.com/restic/restic/internal/debug" "github.com/restic/restic/internal/errors" "github.com/restic/restic/internal/repository/index" "github.com/restic/restic/internal/repository/pack" "github.com/restic/restic/inte...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/repository/repack_test.go
internal/repository/repack_test.go
package repository_test import ( "context" "math/rand" "testing" "time" "github.com/restic/restic/internal/backend" "github.com/restic/restic/internal/repository" "github.com/restic/restic/internal/restic" rtest "github.com/restic/restic/internal/test" "github.com/restic/restic/internal/ui/progress" ) func ...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/repository/fuzz_test.go
internal/repository/fuzz_test.go
package repository import ( "context" "testing" "github.com/restic/restic/internal/restic" rtest "github.com/restic/restic/internal/test" ) // Test saving a blob and loading it again, with varying buffer sizes. // Also a regression test for #3783. func FuzzSaveLoadBlob(f *testing.F) { f.Fuzz(func(t *testing.T, ...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/repository/packer_manager_test.go
internal/repository/packer_manager_test.go
package repository import ( "context" "io" "math/rand" "sync" "testing" "github.com/restic/restic/internal/crypto" "github.com/restic/restic/internal/restic" "github.com/restic/restic/internal/test" ) func randomID(rd io.Reader) restic.ID { id := restic.ID{} _, err := io.ReadFull(rd, id[:]) if err != nil ...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/repository/lock.go
internal/repository/lock.go
package repository import ( "context" "fmt" "sync" "sync/atomic" "time" "github.com/restic/restic/internal/backend" "github.com/restic/restic/internal/debug" "github.com/restic/restic/internal/errors" "github.com/restic/restic/internal/restic" ) type lockContext struct { lock *restic.Lock cancel c...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/repository/check.go
internal/repository/check.go
package repository import ( "bufio" "bytes" "context" "crypto/sha256" "fmt" "io" "sort" "github.com/klauspost/compress/zstd" "github.com/restic/restic/internal/backend" "github.com/restic/restic/internal/debug" "github.com/restic/restic/internal/errors" "github.com/restic/restic/internal/repository/hashin...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false
restic/restic
https://github.com/restic/restic/blob/9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59/internal/repository/repair_index_test.go
internal/repository/repair_index_test.go
package repository_test import ( "context" "math/rand" "testing" "time" "github.com/restic/restic/internal/backend" "github.com/restic/restic/internal/repository" "github.com/restic/restic/internal/restic" rtest "github.com/restic/restic/internal/test" "github.com/restic/restic/internal/ui/progress" ) func ...
go
BSD-2-Clause
9e2d60e28c662ee6e3a3d4f19e9f2d560abf9a59
2026-01-07T08:36:32.238827Z
false