()
| 74 | } |
| 75 | |
| 76 | func (g *GitSource) configureGitRef() error { |
| 77 | contents := g.vendirConfig.Contents() |
| 78 | g.ui.PrintInformationalText("A git reference can be any branch, tag, commit; origin is the name of the remote.") |
| 79 | defaultRef := contents[0].Git.Ref |
| 80 | if defaultRef == "" { |
| 81 | defaultRef = "origin/main" |
| 82 | } |
| 83 | textOpts := ui.TextOpts{ |
| 84 | Label: "Enter Git Reference", |
| 85 | Default: defaultRef, |
| 86 | ValidateFunc: nil, |
| 87 | } |
| 88 | name, err := g.ui.AskForText(textOpts) |
| 89 | if err != nil { |
| 90 | return err |
| 91 | } |
| 92 | |
| 93 | contents[0].Git.Ref = strings.TrimSpace(name) |
| 94 | g.vendirConfig.SetContents(contents) |
| 95 | return g.vendirConfig.Save() |
| 96 | } |
| 97 | |
| 98 | func (g *GitSource) getIncludedPaths() error { |
| 99 | contents := g.vendirConfig.Contents() |
no test coverage detected