mirror of
https://github.com/restic/restic.git
synced 2026-11-28 15:26:48 +00:00
Move FindSnapshot, make Repository.List() return IDs
This commit is contained in:
1 parent
cf37b619fd
commit
6e38a8a033
12 files changed
+75
-97
No files matched your search
+12
@@ -89,3 +89,15 @@ func (sn *Snapshot) fillUserInfo() error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// FindSnapshot takes a string and tries to find a snapshot whose ID matches
|
||||
// the string as closely as possible.
|
||||
func FindSnapshot(repo *repository.Repository, s string) (backend.ID, error) {
|
||||
// find snapshot id with prefix
|
||||
name, err := backend.Find(repo.Backend(), backend.Snapshot, s)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return backend.ParseID(name)
|
||||
}
|
||||
Reference in new issue
Block a user