1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-15 00:15:32 +02:00

don't let patch manager ever be nil

This commit is contained in:
Jesse Duffield
2019-11-05 18:10:47 +11:00
parent 10fe88a2cf
commit cd3874ffb7
6 changed files with 48 additions and 33 deletions

View File

@ -109,7 +109,7 @@ func NewGitCommand(log *logrus.Entry, osCommand *OSCommand, tr *i18n.Localizer,
return nil, err
}
return &GitCommand{
gitCommand := &GitCommand{
Log: log,
OSCommand: osCommand,
Tr: tr,
@ -120,7 +120,11 @@ func NewGitCommand(log *logrus.Entry, osCommand *OSCommand, tr *i18n.Localizer,
getLocalGitConfig: gitconfig.Local,
removeFile: os.RemoveAll,
DotGitDir: dotGitDir,
}, nil
}
gitCommand.PatchManager = NewPatchManager(log, gitCommand.ApplyPatch)
return gitCommand, nil
}
func findDotGitDir(stat func(string) (os.FileInfo, error), readFile func(filename string) ([]byte, error)) (string, error) {