Skip to content

Commit

Permalink
actually run the fetch command
Browse files Browse the repository at this point in the history
  • Loading branch information
Simonis, Matthias authored and Simonis, Matthias committed Mar 1, 2024
1 parent e6189d5 commit a445368
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions golang/vaas/cmd/git-scan/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit a445368

Please sign in to comment.