mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-29 23:17:32 +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)
|
fmt.Print(app.Tr.BareRepo)
|
||||||
|
|
||||||
response, _ := bufio.NewReader(os.Stdin).ReadString('\n')
|
response, _ := bufio.NewReader(os.Stdin).ReadString('\n')
|
||||||
shouldOpenRecent := strings.Trim(response, " \r\n") == "y"
|
|
||||||
|
|
||||||
if shouldOpenRecent {
|
if shouldOpenRecent := strings.Trim(response, " \r\n") == "y"; !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 {
|
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if didOpenRepo := openRecentRepo(app); didOpenRepo {
|
||||||
|
return true, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
fmt.Println(app.Tr.NoRecentRepositories)
|
||||||
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
return false, nil
|
return false, nil
|
||||||
|
Loading…
x
Reference in New Issue
Block a user