diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2019-11-05 18:10:47 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2019-11-05 19:22:01 +1100 |
commit | cd3874ffb7826099574f2661475ff24298d16a64 (patch) | |
tree | 2503e86c6ab46f227ff4ca65503c57cad00f1289 /pkg/commands/git.go | |
parent | 10fe88a2cf79d525f4dfa767b2d0fab1793127e8 (diff) |
don't let patch manager ever be nil
Diffstat (limited to 'pkg/commands/git.go')
-rw-r--r-- | pkg/commands/git.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/pkg/commands/git.go b/pkg/commands/git.go index 42c1749af..1448b37cb 100644 --- a/pkg/commands/git.go +++ b/pkg/commands/git.go @@ -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) { |