-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't show branch heads in reflog subcommits
It's tricky to get this right for reflog commits wrt what's the current branch for each one; so just disable it entirely here, it's probably not something anybody needs here.
- Loading branch information
1 parent
6dc25d7
commit f5c9764
Showing
8 changed files
with
105 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
pkg/integration/tests/reflog/do_not_show_branch_markers_in_reflog_subcommits.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
package reflog | ||
|
||
import ( | ||
"github.com/jesseduffield/lazygit/pkg/config" | ||
. "github.com/jesseduffield/lazygit/pkg/integration/components" | ||
) | ||
|
||
var DoNotShowBranchMarkersInReflogSubcommits = NewIntegrationTest(NewIntegrationTestArgs{ | ||
Description: "Verify that no branch heads are shown in the subcommits view of a reflog entry", | ||
ExtraCmdArgs: []string{}, | ||
Skip: false, | ||
SetupConfig: func(config *config.AppConfig) {}, | ||
SetupRepo: func(shell *Shell) { | ||
shell.NewBranch("branch1") | ||
shell.EmptyCommit("one") | ||
shell.EmptyCommit("two") | ||
shell.NewBranch("branch2") | ||
shell.EmptyCommit("three") | ||
}, | ||
Run: func(t *TestDriver, keys config.KeybindingConfig) { | ||
// Check that the local commits view does show a branch marker for branch1 | ||
t.Views().Commits(). | ||
Lines( | ||
Contains("CI three"), | ||
Contains("CI * two"), | ||
Contains("CI one"), | ||
) | ||
|
||
t.Views().Branches(). | ||
Focus(). | ||
// Check out branch1 | ||
NavigateToLine(Contains("branch1")). | ||
PressPrimaryAction(). | ||
// Look at the subcommits of branch2 | ||
NavigateToLine(Contains("branch2")). | ||
PressEnter(). | ||
// Check that we see a marker for branch1 here (but not for | ||
// branch2), even though branch1 is checked out | ||
Tap(func() { | ||
t.Views().SubCommits(). | ||
IsFocused(). | ||
Lines( | ||
Contains("CI three"), | ||
Contains("CI * two"), | ||
Contains("CI one"), | ||
). | ||
PressEscape() | ||
}). | ||
// Check out branch2 again | ||
NavigateToLine(Contains("branch2")). | ||
PressPrimaryAction() | ||
|
||
t.Views().ReflogCommits(). | ||
Focus(). | ||
TopLines( | ||
Contains("checkout: moving from branch1 to branch2").IsSelected(), | ||
). | ||
PressEnter(). | ||
// Check that the subcommits view for a reflog entry doesn't show | ||
// any branch markers | ||
Tap(func() { | ||
t.Views().SubCommits(). | ||
IsFocused(). | ||
Lines( | ||
Contains("CI three"), | ||
Contains("CI two"), | ||
Contains("CI one"), | ||
) | ||
}) | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters