Skip to content

Commit

Permalink
better output
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 8d8ae8c commit 1d86751
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions golang/vaas/cmd/git-scan/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,22 @@ func main() {
}

gitRevParseCommand := exec.Command("git", "rev-parse", "--show-toplevel")
rootDirectoryBytes, err := gitRevParseCommand.Output()
rootDirectoryBytes, err := gitRevParseCommand.CombinedOutput()
if err != nil {
log.Fatal("git rev-parse: ", err, string(rootDirectoryBytes))
}
rootDirectory := strings.Split(strings.ReplaceAll(string(rootDirectoryBytes), "\r\n", "\n"), "\n")[0]
log.Println("repository root directory: ", rootDirectory)

fetchBytesCommand := exec.Command("git", "fetch", remote, targetBranch)
fetchBytes, err := fetchBytesCommand.Output()
fetchBytes, err := fetchBytesCommand.CombinedOutput()
if err != nil {
log.Fatal("git fetch ", err, string(fetchBytes))
}
log.Println("fetch result: ", string(fetchBytes))

gitDiffCommand := exec.Command("git", "diff", "--name-only", remote+"/"+targetBranch)
diffBytes, err := gitDiffCommand.Output()
diffBytes, err := gitDiffCommand.CombinedOutput()
if err != nil {
log.Fatal("git diff ", err, string(diffBytes))
}
Expand Down

0 comments on commit 1d86751

Please sign in to comment.