mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-03 00:57:52 +02: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()
|
ToArgv()
|
||||||
|
|
||||||
output, err := self.cmd.New(cmdArgs).DontLog().RunWithOutput()
|
output, err := self.cmd.New(cmdArgs).DontLog().RunWithOutput()
|
||||||
if err == nil {
|
if err != nil {
|
||||||
return strings.TrimSpace(output), nil
|
|
||||||
}
|
|
||||||
return "", err
|
return "", err
|
||||||
|
}
|
||||||
|
|
||||||
|
return strings.TrimSpace(output), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// LocalDelete delete branch locally
|
// LocalDelete delete branch locally
|
||||||
|
Reference in New Issue
Block a user