UpdateObjectStorage updates the storer with the objects in the given packfile.
(s storer.Storer, packfile io.Reader)
| 24 | // UpdateObjectStorage updates the storer with the objects in the given |
| 25 | // packfile. |
| 26 | func UpdateObjectStorage(s storer.Storer, packfile io.Reader) error { |
| 27 | if pw, ok := s.(storer.PackfileWriter); ok { |
| 28 | return WritePackfileToObjectStorage(pw, packfile) |
| 29 | } |
| 30 | |
| 31 | p, err := NewParserWithStorage(NewScanner(packfile), s) |
| 32 | if err != nil { |
| 33 | return err |
| 34 | } |
| 35 | |
| 36 | _, err = p.Parse() |
| 37 | return err |
| 38 | } |
| 39 | |
| 40 | // WritePackfileToObjectStorage writes all the packfile objects into the given |
| 41 | // object storage. |
searching dependent graphs…