Skip to content

Commit

Permalink
fix var output
Browse files Browse the repository at this point in the history
  • Loading branch information
unglaublicherdude committed Mar 1, 2024
1 parent 080a1f4 commit cba4ac6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions golang/vaas/cmd/git-scan/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ func main() {
gitRevParseCommand := exec.Command("git", "rev-parse", "--show-toplevel")
rootDirectoryBytes, err := gitRevParseCommand.Output()
if err != nil {
log.Fatal("git rev-parse: ", err, rootDirectory)
log.Fatal("git rev-parse: ", err, string(rootDirectoryBytes))
}
rootDirectory := strings.Split(strings.ReplaceAll(string(rootDirectoryBytes), "\r\n", "\n"), "\n")[0]

exec.Command("git", "fetch", remote, targetBranch)
gitDiffCommand := exec.Command("git", "diff", "--name-only", targetBranch)
diffBytes, err := gitDiffCommand.Output()
if err != nil {
log.Fatal("git diff", err, rootDirectory)
log.Fatal("git diff", err, string(gitDiffCommand))

Check failure on line 62 in golang/vaas/cmd/git-scan/main.go

View workflow job for this annotation

GitHub Actions / vulncheck

cannot convert gitDiffCommand (variable of type *exec.Cmd) to type string

Check failure on line 62 in golang/vaas/cmd/git-scan/main.go

View workflow job for this annotation

GitHub Actions / vulncheck

cannot convert gitDiffCommand (variable of type *exec.Cmd) to type string
}
files := strings.Split(strings.ReplaceAll(string(diffBytes), "\r\n", "\n"), "\n")
if len(files) < 1 {
Expand Down

0 comments on commit cba4ac6

Please sign in to comment.