diff --git a/pkg/gui/controllers.go b/pkg/gui/controllers.go index d7f6647c7..790a6d98b 100644 --- a/pkg/gui/controllers.go +++ b/pkg/gui/controllers.go @@ -9,6 +9,7 @@ import ( "github.com/jesseduffield/lazygit/pkg/gui/controllers/helpers" "github.com/jesseduffield/lazygit/pkg/gui/modes/cherrypicking" "github.com/jesseduffield/lazygit/pkg/gui/services/custom_commands" + "github.com/jesseduffield/lazygit/pkg/gui/types" "github.com/jesseduffield/lazygit/pkg/snake" ) @@ -92,6 +93,9 @@ func (gui *Gui) resetControllers() { onCommitSuccess := func() { gui.State.savedCommitMessage = "" + _ = gui.c.Refresh(types.RefreshOptions{ + Scope: []types.RefreshableView{types.STAGING}, + }) } commitMessageController := controllers.NewCommitMessageController( diff --git a/pkg/integration/tests/commit/staged.go b/pkg/integration/tests/commit/staged.go index 09bcf2815..f5e45995d 100644 --- a/pkg/integration/tests/commit/staged.go +++ b/pkg/integration/tests/commit/staged.go @@ -53,8 +53,12 @@ var Staged = NewIntegrationTest(NewIntegrationTestArgs{ Contains(commitMessage), ) - t.Views().StagingSecondary().IsFocused() + t.Views().StagingSecondary(). + IsEmpty() - // TODO: assert that the staging panel has been refreshed (it currently does not get correctly refreshed) + t.Views().Staging(). + IsFocused(). + Content(Contains("+myfile content")). + Content(DoesNotContain("+with a second line")) }, }) diff --git a/pkg/integration/tests/commit/staged_without_hooks.go b/pkg/integration/tests/commit/staged_without_hooks.go index 620f712f9..dcf20d08d 100644 --- a/pkg/integration/tests/commit/staged_without_hooks.go +++ b/pkg/integration/tests/commit/staged_without_hooks.go @@ -53,8 +53,12 @@ var StagedWithoutHooks = NewIntegrationTest(NewIntegrationTestArgs{ Contains("WIP" + commitMessage), ) - t.Views().StagingSecondary().IsFocused() + t.Views().StagingSecondary(). + IsEmpty() - // TODO: assert that the staging panel has been refreshed (it currently does not get correctly refreshed) + t.Views().Staging(). + IsFocused(). + Content(Contains("+myfile content")). + Content(DoesNotContain("+with a second line")) }, })