1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-31 14:24:25 +03:00

Merge pull request #2377 from shinhs0506/clear-staging-after-commit

This commit is contained in:
Jesse Duffield
2023-03-24 19:13:00 +11:00
committed by GitHub
5 changed files with 40 additions and 12 deletions

View File

@ -63,9 +63,9 @@ type ContextManager struct {
sync.RWMutex
}
func NewContextManager(initialContext types.Context) ContextManager {
func NewContextManager() ContextManager {
return ContextManager{
ContextStack: []types.Context{initialContext},
ContextStack: []types.Context{},
RWMutex: sync.RWMutex{},
}
}
@ -298,11 +298,15 @@ func (gui *Gui) resetState(startArgs appTypes.StartArgs, reuseState bool) {
},
ScreenMode: initialScreenMode,
// TODO: put contexts in the context manager
ContextManager: NewContextManager(initialContext),
ContextManager: NewContextManager(),
Contexts: contextTree,
WindowViewNameMap: initialWindowViewNameMap,
}
if err := gui.c.PushContext(initialContext); err != nil {
gui.c.Log.Error(err)
}
gui.RepoStateMap[Repo(currentDir)] = gui.State
}