declare Buffer instead of using NewBuffer

Co-Authored-By: David Genest <david.genest@gmail.com>
This commit is contained in:
Benoit Gagnon 2019-10-24 10:46:51 -04:00 committed by GitHub
parent f4b09c811e
commit a44fae09a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -144,7 +144,7 @@ func gzipUntar(dst string, r io.Reader, subDir string) error {
} }
func remoteResolveRef(ctx context.Context, remote string, ref string) (string, error) { func remoteResolveRef(ctx context.Context, remote string, ref string) (string, error) {
b := bytes.NewBuffer(nil) b := &bytes.Buffer{}
cmd := exec.CommandContext(ctx, "git", "ls-remote", "--heads", "--tags", "--refs", "--quiet", remote, ref) cmd := exec.CommandContext(ctx, "git", "ls-remote", "--heads", "--tags", "--refs", "--quiet", remote, ref)
cmd.Stdin = os.Stdin cmd.Stdin = os.Stdin
cmd.Stdout = b cmd.Stdout = b