mirror of
https://github.com/Jguer/yay
synced 2024-10-05 23:59:13 +00:00
Fix devel updates
Commit 474cc56f8d
refactored the
getCommit() function to use the standard passToGit() and capture()
functions.
Unlike every other external call, here we use .Wait() and kill the
command after 5 seconds. This was missed and ended up breaking the
function.
So instead don't use capture but the manual .Wait() call. passToGit() is
still used.
This commit is contained in:
parent
23e0064382
commit
b5b6928803
10
vcs.go
10
vcs.go
|
@ -1,6 +1,7 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"os"
|
||||
|
@ -134,9 +135,13 @@ func updateVCSData(pkgName string, sources []gosrc.ArchString) {
|
|||
|
||||
func getCommit(url string, branch string, protocols []string) string {
|
||||
for _, protocol := range protocols {
|
||||
cmd := passToGit("ls-remote", protocol+"://"+url, branch)
|
||||
var outbuf bytes.Buffer
|
||||
|
||||
cmd := passToGit("", "ls-remote", protocol+"://"+url, branch)
|
||||
cmd.Stdout = &outbuf
|
||||
cmd.Env = append(os.Environ(), "GIT_TERMINAL_PROMPT=0")
|
||||
stdout, _, err := capture(cmd)
|
||||
|
||||
err := cmd.Start()
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
|
@ -155,6 +160,7 @@ func getCommit(url string, branch string, protocols []string) string {
|
|||
continue
|
||||
}
|
||||
|
||||
stdout := outbuf.String()
|
||||
split := strings.Fields(stdout)
|
||||
|
||||
if len(split) < 2 {
|
||||
|
|
Loading…
Reference in a new issue