(dt []byte, err error)
| 104 | } |
| 105 | |
| 106 | func (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 | |
| 115 | func (cli *GitCLI) currentRemote(ctx context.Context) (string, error) { |
| 116 | symref, err := cli.clean(cli.Run(ctx, "symbolic-ref", "-q", "HEAD")) |
no test coverage detected