1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-08-06 22:33:07 +02:00

Add a test showing undesired branch icon at head commit

The icon will appear when there's a tag with the same name as the current branch
(that's what we're testing here), or even when there's a remote with the same
name. I'm not adding a test for this latter case, but this was actually how I
discovered the issue.
This commit is contained in:
Stefan Haller
2025-06-27 14:13:31 +02:00
parent 7a8937279a
commit 61815c10e7
2 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1,34 @@
package commit
import (
"github.com/jesseduffield/lazygit/pkg/config"
. "github.com/jesseduffield/lazygit/pkg/integration/components"
)
var DoNotShowBranchMarkerForHeadCommit = NewIntegrationTest(NewIntegrationTestArgs{
Description: "Verify that no branch heads are shown for the branch head if there is a tag with the same name as the branch",
ExtraCmdArgs: []string{},
Skip: false,
GitVersion: AtLeast("2.38.0"),
SetupConfig: func(config *config.AppConfig) {
config.GetAppState().GitLogShowGraph = "never"
},
SetupRepo: func(shell *Shell) {
shell.EmptyCommit("one")
shell.NewBranch("branch1")
shell.EmptyCommit("two")
shell.EmptyCommit("three")
shell.CreateLightweightTag("branch1", "master")
shell.SetConfig("rebase.updateRefs", "true")
},
Run: func(t *TestDriver, keys config.KeybindingConfig) {
// Check that the local commits view does show a branch marker for the head commit
t.Views().Commits().
Lines(
Contains("CI * three"), // don't want the star here
Contains("CI two"),
Contains("CI branch1 one"),
)
},
})

View File

@ -118,6 +118,7 @@ var tests = []*components.IntegrationTest{
commit.CreateTag,
commit.DisableCopyCommitMessageBody,
commit.DiscardOldFileChanges,
commit.DoNotShowBranchMarkerForHeadCommit,
commit.FailHooksThenCommitNoHooks,
commit.FindBaseCommitForFixup,
commit.FindBaseCommitForFixupDisregardMainBranch,