1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-05-27 23:08:02 +02:00

Refactor branching logic

This commit is contained in:
nullishamy 2022-08-01 21:54:54 +01:00
parent a658cd4076
commit 0b4f9f8c76
No known key found for this signature in database
GPG Key ID: 5BAB63DCC2BF4F58

View File

@ -239,19 +239,17 @@ func (app *App) setupRepo() (bool, error) {
fmt.Print(app.Tr.BareRepo)
response, _ := bufio.NewReader(os.Stdin).ReadString('\n')
shouldOpenRecent := strings.Trim(response, " \r\n") == "y"
if shouldOpenRecent {
if didOpenRepo := openRecentRepo(app); !didOpenRepo {
fmt.Println(app.Tr.NoRecentRepositories)
os.Exit(1)
}
// We managed to open a recent repo, continue as usual
return true, nil
} else {
if shouldOpenRecent := strings.Trim(response, " \r\n") == "y"; !shouldOpenRecent {
os.Exit(0)
}
if didOpenRepo := openRecentRepo(app); didOpenRepo {
return true, nil
}
fmt.Println(app.Tr.NoRecentRepositories)
os.Exit(1)
}
return false, nil