From a44536840761e29c5729536e1919a912bd6cac22 Mon Sep 17 00:00:00 2001 From: "Simonis, Matthias" Date: Fri, 1 Mar 2024 12:07:13 +0000 Subject: [PATCH] actually run the fetch command --- golang/vaas/cmd/git-scan/main.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/golang/vaas/cmd/git-scan/main.go b/golang/vaas/cmd/git-scan/main.go index f12ce090..e6be7df0 100644 --- a/golang/vaas/cmd/git-scan/main.go +++ b/golang/vaas/cmd/git-scan/main.go @@ -55,11 +55,15 @@ func main() { } rootDirectory := strings.Split(strings.ReplaceAll(string(rootDirectoryBytes), "\r\n", "\n"), "\n")[0] - exec.Command("git", "fetch", remote, targetBranch) + fetchBytesCommand := exec.Command("git", "fetch", remote, targetBranch) + fetchBytes, err := fetchBytesCommand.Output() + if err != nil { + log.Fatal("git fetch ", err, string(fetchBytes)) + } gitDiffCommand := exec.Command("git", "diff", "--name-only", targetBranch) diffBytes, err := gitDiffCommand.Output() if err != nil { - log.Fatal("git diff", err, string(diffBytes)) + log.Fatal("git diff ", err, string(diffBytes)) } files := strings.Split(strings.ReplaceAll(string(diffBytes), "\r\n", "\n"), "\n") if len(files) < 1 {