Skip to content
Permalink
Browse files

Add the "siva unpack" implementation

Signed-off-by: Vadim Markovtsev <vadim@sourced.tech>
  • Loading branch information...
vmarkovtsev committed Sep 26, 2019
1 parent 86d04de commit 2d08e8bed4aa77b284f41973d100542721c0a0b2
Showing with 18 additions and 1 deletion.
  1. +13 −1 PublicGitArchive/pga/cmd/siva.go
  2. +1 −0 PublicGitArchive/pga/go.mod
  3. +4 −0 PublicGitArchive/pga/go.sum
@@ -21,6 +21,7 @@ import (
"gopkg.in/src-d/go-git.v4/plumbing/filemode"
"gopkg.in/src-d/go-git.v4/plumbing/object"
"gopkg.in/src-d/go-git.v4/storage/filesystem"
"gopkg.in/src-d/go-siva.v1/cmd/siva/impl"
)

var actions = map[string]func(flags *pflag.FlagSet) error{
@@ -30,7 +31,18 @@ var actions = map[string]func(flags *pflag.FlagSet) error{
}

func unpack(flags *pflag.FlagSet) error {
return nil
var err error
cmd := &impl.CmdUnpack{Overwrite: true, IgnorePerms: true}
cmd.Args.File = flags.Arg(1)
cmd.Output.Path, err = flags.GetString("output")
if err != nil {
return err
}
cmd.Match, err = flags.GetString("match")
if err != nil {
return err
}
return cmd.Execute(nil)
}

func dump(flags *pflag.FlagSet) error {
@@ -16,4 +16,5 @@ require (
gopkg.in/src-d/go-billy-siva.v4 v4.6.0
gopkg.in/src-d/go-billy.v4 v4.3.2
gopkg.in/src-d/go-git.v4 v4.13.1
gopkg.in/src-d/go-siva.v1 v1.8.0
)
@@ -16,6 +16,7 @@ github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7Do
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo=
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg=
github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o=
@@ -35,6 +36,7 @@ github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NH
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A=
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo=
github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA=
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd h1:Coekwdh0v2wtGp9Gmz1Ze3eVRAWJMLokvN3QjdzCHLY=
github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM=
@@ -128,6 +130,8 @@ gopkg.in/src-d/go-git.v4 v4.13.1 h1:SRtFyV8Kxc0UP7aCHcijOMQGPxHSmMOPrzulQWolkYE=
gopkg.in/src-d/go-git.v4 v4.13.1/go.mod h1:nx5NYcxdKxq5fpltdHnPa2Exj4Sx0EclMWZQbYDu2z8=
gopkg.in/src-d/go-siva.v1 v1.7.0 h1:igjgSEFweZ2kEfRlGEJH767o8GJRiPWp8JmHDCe0Vdk=
gopkg.in/src-d/go-siva.v1 v1.7.0/go.mod h1:ChxMHSRkICHZ9IbTlG3ihkuG7gc2RZPsIYh7OaXYvic=
gopkg.in/src-d/go-siva.v1 v1.8.0 h1:CuQv2BUvndwXmsv8gQBeI7ZynOwViIRM8JYhxAq69HI=
gopkg.in/src-d/go-siva.v1 v1.8.0/go.mod h1:ChxMHSRkICHZ9IbTlG3ihkuG7gc2RZPsIYh7OaXYvic=
gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME=
gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=

0 comments on commit 2d08e8b

Please sign in to comment.
You can’t perform that action at this time.