@@ -70,8 +70,8 @@ func (t *E2ETester) Start() (*E2EResult, error) {
70
70
log .Printf ("checking out branch %q" , branchName )
71
71
checkoutCmd := exec .Command ("git" , "checkout" , "-b" , branchName )
72
72
checkoutCmd .Dir = cloneDir
73
- if err := checkoutCmd .Run (); err != nil {
74
- return e2eResult , fmt .Errorf ("failed to git checkout branch %q: %v" , branchName , err )
73
+ if output , err := checkoutCmd .CombinedOutput (); err != nil {
74
+ return e2eResult , fmt .Errorf ("failed to git checkout branch %q: %v: %s " , branchName , err , string ( output ) )
75
75
}
76
76
77
77
// write a file for running the tests
@@ -87,25 +87,24 @@ func (t *E2ETester) Start() (*E2EResult, error) {
87
87
log .Printf ("git add file %q" , filePath )
88
88
addCmd := exec .Command ("git" , "add" , filePath )
89
89
addCmd .Dir = cloneDir
90
- if err = addCmd .Run (); err != nil {
91
- return e2eResult , fmt .Errorf ("failed to git add file %q: %v" , filePath , err )
90
+ if output , err : = addCmd .CombinedOutput (); err != nil {
91
+ return e2eResult , fmt .Errorf ("failed to git add file %q: %v: %s " , filePath , err , string ( output ) )
92
92
}
93
93
94
94
// commit the file
95
95
log .Printf ("git commit file %q" , filePath )
96
96
commitCmd := exec .Command ("git" , "commit" , "-am" , "test commit" )
97
97
commitCmd .Dir = cloneDir
98
- var output []byte
99
- if output , err = commitCmd .CombinedOutput (); err != nil {
98
+ if output , err := commitCmd .CombinedOutput (); err != nil {
100
99
return e2eResult , fmt .Errorf ("failed to run git commit in %q: %v: %v" , cloneDir , err , string (output ))
101
100
}
102
101
103
102
// push the branch to remote
104
103
log .Printf ("git push branch %q" , branchName )
105
104
pushCmd := exec .Command ("git" , "push" , "origin" , branchName )
106
105
pushCmd .Dir = cloneDir
107
- if err = pushCmd .Run (); err != nil {
108
- return e2eResult , fmt .Errorf ("failed to git push branch %q: %v" , branchName , err )
106
+ if output , err : = pushCmd .CombinedOutput (); err != nil {
107
+ return e2eResult , fmt .Errorf ("failed to git push branch %q: %v: %s " , branchName , err , string ( output ) )
109
108
}
110
109
111
110
// create a new pr
0 commit comments