git_tools: add even more detail when commit fails
Follow-up to 32577b177e34bc7b23183df22d375c9ada146613
diff --git a/git_tools/git_tools.go b/git_tools/git_tools.go
index 242a8de..d047710 100644
--- a/git_tools/git_tools.go
+++ b/git_tools/git_tools.go
@@ -437,8 +437,8 @@
// Add the file to git
cmd = exec.CommandContext(ctx, "git", "add", filePath)
cmd.Dir = repoDir
- if err := cmd.Run(); err != nil {
- return fmt.Errorf("error adding file to git: %w", err)
+ if out, err := cmd.CombinedOutput(); err != nil {
+ return fmt.Errorf("error adding file to git: %w - git output: %s", err, string(out))
}
// Commit the changes