1
0
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:
Stefan Haller
2025-06-27 14:42:59 +02:00
parent 61815c10e7
commit f95ac6780f

View File

@ -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