MCPcopy Create free account
hub / github.com/docker/buildx / clean

Method clean

util/gitutil/gitutil.go:106–113  ·  view source on GitHub ↗
(dt []byte, err error)

Source from the content-addressed store, hash-verified

104}
105
106func (cli *GitCLI) clean(dt []byte, err error) (string, error) {
107 out := string(dt)
108 out = strings.ReplaceAll(strings.Split(out, "\n")[0], "'", "")
109 if err != nil {
110 err = errors.New(strings.TrimSuffix(err.Error(), "\n"))
111 }
112 return out, err
113}
114
115func (cli *GitCLI) currentRemote(ctx context.Context) (string, error) {
116 symref, err := cli.clean(cli.Run(ctx, "symbolic-ref", "-q", "HEAD"))

Callers 6

IsInsideWorkTreeMethod · 0.95
RemoteURLMethod · 0.95
FullCommitMethod · 0.95
ShortCommitMethod · 0.95
TagMethod · 0.95
currentRemoteMethod · 0.95

Calls 2

NewMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected