2021-12-29 05:33:38 +02:00
package commands
import (
"github.com/jesseduffield/lazygit/pkg/commands/oscommands"
"github.com/sirupsen/logrus"
)
// here we're wrapping the default command runner in some git-specific stuff e.g. retry logic if we get an error due to the presence of .git/index.lock
type gitCmdObjRunner struct {
log * logrus . Entry
innerRunner oscommands . ICmdObjRunner
}
func ( self * gitCmdObjRunner ) Run ( cmdObj oscommands . ICmdObj ) error {
_ , err := self . RunWithOutput ( cmdObj )
return err
}
func ( self * gitCmdObjRunner ) RunWithOutput ( cmdObj oscommands . ICmdObj ) ( string , error ) {
2022-01-27 12:15:12 +02:00
return self . innerRunner . RunWithOutput ( cmdObj )
2021-12-29 05:33:38 +02:00
}
2021-12-30 02:22:29 +02:00
func ( self * gitCmdObjRunner ) RunAndProcessLines ( cmdObj oscommands . ICmdObj , onLine func ( line string ) ( bool , error ) ) error {
return self . innerRunner . RunAndProcessLines ( cmdObj , onLine )
2021-12-29 05:33:38 +02:00
}