forked from jesseduffield/lazygit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When there's a branch with the same name as the tag, the branch gets checked out instead of the tag.
- Loading branch information
1 parent
af5e25c
commit 2b97f0f
Showing
2 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
pkg/integration/tests/tag/checkout_when_branch_with_same_name_exists.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,38 @@ | ||
package tag | ||
|
||
import ( | ||
"github.com/jesseduffield/lazygit/pkg/config" | ||
. "github.com/jesseduffield/lazygit/pkg/integration/components" | ||
) | ||
|
||
var CheckoutWhenBranchWithSameNameExists = NewIntegrationTest(NewIntegrationTestArgs{ | ||
Description: "Checkout a tag when there's a branch with the same name", | ||
ExtraCmdArgs: []string{}, | ||
Skip: false, | ||
SetupConfig: func(config *config.AppConfig) {}, | ||
SetupRepo: func(shell *Shell) { | ||
shell.EmptyCommit("one") | ||
shell.NewBranch("tag") | ||
shell.Checkout("master") | ||
shell.EmptyCommit("two") | ||
shell.CreateLightweightTag("tag", "HEAD") | ||
}, | ||
Run: func(t *TestDriver, keys config.KeybindingConfig) { | ||
t.Views().Tags(). | ||
Focus(). | ||
Lines( | ||
Contains("tag").IsSelected(), | ||
). | ||
PressPrimaryAction() // checkout tag | ||
|
||
t.Views().Branches().IsFocused().Lines( | ||
/* EXPECTED: | ||
Contains("HEAD detached at tag").IsSelected(), | ||
Contains("master"), | ||
Contains("tag"), | ||
ACTUAL: */ | ||
Contains("* tag").DoesNotContain("HEAD detached").IsSelected(), | ||
Contains("master"), | ||
) | ||
}, | ||
}) |
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