mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 04:15:48 +02:00
Do not quote initial branch arg when creating repo
Also, we shouldn't pass the initial branch arg if it's empty.
This commit is contained in:
parent
5ba1eb2785
commit
d4eae73a68
1 changed files with 6 additions and 2 deletions
|
@ -194,7 +194,7 @@ func (app *App) setupRepo() (bool, error) {
|
||||||
fmt.Print(app.Tr.InitialBranch)
|
fmt.Print(app.Tr.InitialBranch)
|
||||||
response, _ := bufio.NewReader(os.Stdin).ReadString('\n')
|
response, _ := bufio.NewReader(os.Stdin).ReadString('\n')
|
||||||
if trimmedResponse := strings.Trim(response, " \r\n"); len(trimmedResponse) > 0 {
|
if trimmedResponse := strings.Trim(response, " \r\n"); len(trimmedResponse) > 0 {
|
||||||
initialBranchArg += "--initial-branch=" + app.OSCommand.Quote(trimmedResponse)
|
initialBranchArg += "--initial-branch=" + trimmedResponse
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case "create":
|
case "create":
|
||||||
|
@ -210,7 +210,11 @@ func (app *App) setupRepo() (bool, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if shouldInitRepo {
|
if shouldInitRepo {
|
||||||
if err := app.OSCommand.Cmd.New([]string{"git", "init", initialBranchArg}).Run(); err != nil {
|
args := []string{"git", "init"}
|
||||||
|
if initialBranchArg != "" {
|
||||||
|
args = append(args, initialBranchArg)
|
||||||
|
}
|
||||||
|
if err := app.OSCommand.Cmd.New(args).Run(); err != nil {
|
||||||
return false, err
|
return false, err
|
||||||
}
|
}
|
||||||
return false, nil
|
return false, nil
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue