@@ -27,15 +27,15 @@ func (impl *GitUtil) Fetch(rootDir string, username string, password string) (re
27
27
cmd := exec .Command ("git" , "-C" , rootDir , "fetch" , "origin" , "--tags" , "--force" )
28
28
output , errMsg , err := impl .runCommandWithCred (cmd , username , password )
29
29
impl .logger .Debugw ("fetch output" , "root" , rootDir , "opt" , output , "errMsg" , errMsg , "error" , err )
30
- return output , errMsg , nil
30
+ return output , errMsg , err
31
31
}
32
32
33
33
func (impl * GitUtil ) Checkout (rootDir string , branch string ) (response , errMsg string , err error ) {
34
34
impl .logger .Debugw ("git checkout " , "location" , rootDir )
35
35
cmd := exec .Command ("git" , "-C" , rootDir , "checkout" , branch , "--force" )
36
36
output , errMsg , err := impl .runCommand (cmd )
37
37
impl .logger .Debugw ("checkout output" , "root" , rootDir , "opt" , output , "errMsg" , errMsg , "error" , err )
38
- return output , errMsg , nil
38
+ return output , errMsg , err
39
39
}
40
40
41
41
func (impl * GitUtil ) runCommandWithCred (cmd * exec.Cmd , userName , password string ) (response , errMsg string , err error ) {
@@ -51,9 +51,10 @@ func (impl *GitUtil) runCommand(cmd *exec.Cmd) (response, errMsg string, err err
51
51
cmd .Env = append (cmd .Env , "HOME=/dev/null" )
52
52
outBytes , err := cmd .CombinedOutput ()
53
53
if err != nil {
54
+ impl .logger .Error ("error in git cli operation" , "msg" , string (outBytes ), "err" , err )
54
55
exErr , ok := err .(* exec.ExitError )
55
56
if ! ok {
56
- return "" , "" , err
57
+ return "" , string ( outBytes ) , err
57
58
}
58
59
errOutput := string (exErr .Stderr )
59
60
return "" , errOutput , err
0 commit comments