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:
parent
a658cd4076
commit
0b4f9f8c76
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user