mirror of
https://github.com/restic/restic.git
synced 2025-03-09 00:00:02 +01:00
Merge c328f45333
into de9a040d27
This commit is contained in:
commit
222f2649c2
2 changed files with 18 additions and 1 deletions
|
@ -5,6 +5,7 @@ package main
|
|||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
"time"
|
||||
|
@ -148,9 +149,16 @@ func runMount(ctx context.Context, opts MountOptions, gopts GlobalOptions, args
|
|||
return err
|
||||
}
|
||||
|
||||
repositoryID, err := repo.ID()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
fuseMountName := fmt.Sprintf("restic:%s", repositoryID.Str())
|
||||
|
||||
mountOptions := []systemFuse.MountOption{
|
||||
systemFuse.ReadOnly(),
|
||||
systemFuse.FSName("restic"),
|
||||
systemFuse.FSName(fuseMountName),
|
||||
systemFuse.MaxReadahead(128 * 1024),
|
||||
}
|
||||
|
||||
|
|
|
@ -143,6 +143,15 @@ func (r *Repository) Config() restic.Config {
|
|||
return r.cfg
|
||||
}
|
||||
|
||||
// ID returns the repository ID.
|
||||
func (r *Repository) ID() (restic.ID, error) {
|
||||
id, err := restic.ParseID(r.cfg.ID)
|
||||
if err != nil {
|
||||
return restic.ID{}, err
|
||||
}
|
||||
return id, nil
|
||||
}
|
||||
|
||||
// packSize return the target size of a pack file when uploading
|
||||
func (r *Repository) packSize() uint {
|
||||
return r.opts.PackSize
|
||||
|
|
Loading…
Add table
Reference in a new issue