@@ -14,8 +14,8 @@ import (
14
14
"path/filepath"
15
15
"strings"
16
16
17
- "gopkg.in/gcfg.v1"
18
17
"golang.org/x/crypto/ssh"
18
+ "gopkg.in/gcfg.v1"
19
19
)
20
20
21
21
// Formatted script that checks if the build happened.
@@ -111,22 +111,22 @@ func (r *Remote) Push() error {
111
111
}
112
112
if key , err := NewKeyFile (r .sshConfig .Identity ); err == nil {
113
113
cmd := exec .Command ("ssh-add" , key )
114
- if _ , err = cmd .CombinedOutput (); err != nil {
115
- return err
114
+ if output , err : = cmd .CombinedOutput (); err != nil {
115
+ return fmt . Errorf ( "%s \n %s" , string ( output ), err )
116
116
}
117
117
}
118
118
cmd := exec .Command ("git" , "rev-parse" , "--abbrev-ref" , "HEAD" )
119
119
cmd .Dir = r .Git .Work
120
120
b , err := cmd .CombinedOutput ()
121
121
if err != nil {
122
- return err
122
+ return fmt . Errorf ( "HEAD does not exist. Did you make a commit?" )
123
123
}
124
124
branch := strings .TrimSpace (string (b ))
125
125
if branch == "HEAD" {
126
126
branch = fmt .Sprintf ("%s:refs/heads/happened" , branch )
127
127
}
128
128
if err := r .Initialize (); err != nil {
129
- return fmt .Errorf ("%s\n %s " , err )
129
+ return fmt .Errorf ("%s\n " , err )
130
130
}
131
131
if output , err := r .Git .Push (branch ); err != nil {
132
132
return fmt .Errorf ("%s\n %s" , string (output ), err )
@@ -148,8 +148,8 @@ func (r *Remote) PushSubmodules() error {
148
148
}
149
149
cmd := exec .Command ("git" , "submodule" , "update" , "--init" )
150
150
cmd .Dir = r .Git .Work
151
- if _ , err := cmd .CombinedOutput (); err != nil {
152
- return err
151
+ if output , err := cmd .CombinedOutput (); err != nil {
152
+ return fmt . Errorf ( "%s \n %s" , string ( output ), err )
153
153
}
154
154
errors := []string {}
155
155
for _ , module := range modules .Submodules {
0 commit comments