MCPcopy
hub / github.com/redspread/spread / Pull

Method Pull

cli/pull.go:11–38  ·  view source on GitHub ↗

Pull allows references to be pulled from a remote.

()

Source from the content-addressed store, hash-verified

9
10// Pull allows references to be pulled from a remote.
11func (s SpreadCli) Pull() *cli.Command {
12 return &cli.Command{
13 Name: "pull",
14 Usage: "Pull changes from a remote branch",
15 ArgsUsage: "<remote> <branch>",
16 Description: "Pull Spread data from a remote branch",
17 Action: func(c *cli.Context) {
18 remoteName := c.Args().First()
19 if len(remoteName) == 0 {
20 s.fatalf("a remote must be specified")
21 }
22
23 if len(c.Args()) < 2 {
24 s.fatalf("a refspec must be specified")
25 }
26
27 refspec := c.Args().Get(1)
28 if !strings.HasPrefix(refspec, "refs/") {
29 refspec = fmt.Sprintf("refs/heads/%s", refspec)
30 }
31
32 p := s.projectOrDie()
33 if err := p.Pull(remoteName, refspec); err != nil {
34 s.fatalf("Failed to pull: %v", err)
35 }
36 },
37 }
38}

Callers

nothing calls this directly

Calls 3

fatalfMethod · 0.95
projectOrDieMethod · 0.95
GetMethod · 0.45

Tested by

no test coverage detected