mirror of
https://github.com/Jguer/yay
synced 2024-08-31 21:58:39 +00:00
Use passToGit() in getCommit()
This commit is contained in:
parent
8427dc3804
commit
474cc56f8d
11
vcs.go
11
vcs.go
|
@ -1,11 +1,9 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
@ -136,13 +134,9 @@ func updateVCSData(pkgName string, sources []gosrc.ArchString) {
|
||||||
|
|
||||||
func getCommit(url string, branch string, protocols []string) string {
|
func getCommit(url string, branch string, protocols []string) string {
|
||||||
for _, protocol := range protocols {
|
for _, protocol := range protocols {
|
||||||
var outbuf bytes.Buffer
|
cmd := passToGit("ls-remote", protocol+"://"+url, branch)
|
||||||
|
|
||||||
cmd := exec.Command(config.GitBin, "ls-remote", protocol+"://"+url, branch)
|
|
||||||
cmd.Stdout = &outbuf
|
|
||||||
cmd.Env = append(cmd.Env, "GIT_TERMINAL_PROMPT=0")
|
cmd.Env = append(cmd.Env, "GIT_TERMINAL_PROMPT=0")
|
||||||
|
stdout, _, err := capture(cmd)
|
||||||
err := cmd.Start()
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
@ -161,7 +155,6 @@ func getCommit(url string, branch string, protocols []string) string {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
stdout := outbuf.String()
|
|
||||||
split := strings.Fields(stdout)
|
split := strings.Fields(stdout)
|
||||||
|
|
||||||
if len(split) < 2 {
|
if len(split) < 2 {
|
||||||
|
|
Loading…
Reference in a new issue