mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-03 12:22:34 +03:00
Cleanup: turn around error condition
It is a common go convention for the "happy path" to be as little indented as possible.
This commit is contained in:
@ -111,10 +111,11 @@ func (self *BranchCommands) CurrentBranchName() (string, error) {
|
||||
ToArgv()
|
||||
|
||||
output, err := self.cmd.New(cmdArgs).DontLog().RunWithOutput()
|
||||
if err == nil {
|
||||
return strings.TrimSpace(output), nil
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return "", err
|
||||
|
||||
return strings.TrimSpace(output), nil
|
||||
}
|
||||
|
||||
// LocalDelete delete branch locally
|
||||
|
Reference in New Issue
Block a user