Move FindSnapshot, make Repository.List() return IDs

This commit is contained in:
Alexander Neumann committed 2015-05-17 20:58:22 +02:00
1 parent cf37b619fd
commit 6e38a8a033
12 files changed
+75 -97

No files matched your search

+12
View File
@@ -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)
}