1
0
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:
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()
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