mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-04-15 11:56:37 +02:00
Merge pull request #2455 from jesseduffield/wow-even-more-test-migrations
This commit is contained in:
commit
c13f550d63
8
.vscode/tasks.json
vendored
8
.vscode/tasks.json
vendored
@ -24,7 +24,7 @@
|
||||
{
|
||||
"label": "Run current file integration test",
|
||||
"type": "shell",
|
||||
"command": "go run cmd/integration_test/main.go cli ${relativeFile}",
|
||||
"command": "go generate pkg/integration/tests/tests.go && go run cmd/integration_test/main.go cli ${relativeFile}",
|
||||
"problemMatcher": [],
|
||||
"group": {
|
||||
"kind": "test",
|
||||
@ -37,7 +37,7 @@
|
||||
{
|
||||
"label": "Run current file integration test (slow)",
|
||||
"type": "shell",
|
||||
"command": "go run cmd/integration_test/main.go cli --slow ${relativeFile}",
|
||||
"command": "go generate pkg/integration/tests/tests.go && go run cmd/integration_test/main.go cli --slow ${relativeFile}",
|
||||
"problemMatcher": [],
|
||||
"group": {
|
||||
"kind": "test",
|
||||
@ -49,7 +49,7 @@
|
||||
{
|
||||
"label": "Run current file integration test (sandbox)",
|
||||
"type": "shell",
|
||||
"command": "go run cmd/integration_test/main.go cli --sandbox ${relativeFile}",
|
||||
"command": "go generate pkg/integration/tests/tests.go && go run cmd/integration_test/main.go cli --sandbox ${relativeFile}",
|
||||
"problemMatcher": [],
|
||||
"group": {
|
||||
"kind": "test",
|
||||
@ -73,7 +73,7 @@
|
||||
{
|
||||
"label": "Sync tests list",
|
||||
"type": "shell",
|
||||
"command": "go generate ./...",
|
||||
"command": "go generate pkg/integration/tests/tests.go",
|
||||
"problemMatcher": [],
|
||||
"group": {
|
||||
"kind": "test",
|
||||
|
@ -1,6 +1,8 @@
|
||||
package git_commands
|
||||
|
||||
import (
|
||||
"regexp"
|
||||
|
||||
"github.com/jesseduffield/generics/slices"
|
||||
"github.com/jesseduffield/lazygit/pkg/commands/models"
|
||||
"github.com/jesseduffield/lazygit/pkg/commands/oscommands"
|
||||
@ -26,16 +28,26 @@ func NewTagLoader(
|
||||
func (self *TagLoader) GetTags() ([]*models.Tag, error) {
|
||||
// get remote branches, sorted by creation date (descending)
|
||||
// see: https://git-scm.com/docs/git-tag#Documentation/git-tag.txt---sortltkeygt
|
||||
tagsOutput, err := self.cmd.New(`git tag --list --sort=-creatordate`).DontLog().RunWithOutput()
|
||||
tagsOutput, err := self.cmd.New(`git tag --list -n --sort=-creatordate`).DontLog().RunWithOutput()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
split := utils.SplitLines(tagsOutput)
|
||||
|
||||
tags := slices.Map(split, func(tagName string) *models.Tag {
|
||||
lineRegex := regexp.MustCompile(`^([^\s]+)(\s+)?(.*)$`)
|
||||
|
||||
tags := slices.Map(split, func(line string) *models.Tag {
|
||||
matches := lineRegex.FindStringSubmatch(line)
|
||||
tagName := matches[1]
|
||||
message := ""
|
||||
if len(matches) > 3 {
|
||||
message = matches[3]
|
||||
}
|
||||
|
||||
return &models.Tag{
|
||||
Name: tagName,
|
||||
Name: tagName,
|
||||
Message: message,
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -9,12 +9,9 @@ import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
const tagsOutput = `v0.34
|
||||
v0.33
|
||||
v0.32.2
|
||||
v0.32.1
|
||||
v0.32
|
||||
testtag
|
||||
const tagsOutput = `tag1 this is my message
|
||||
tag2
|
||||
tag3 this is my other message
|
||||
`
|
||||
|
||||
func TestGetTags(t *testing.T) {
|
||||
@ -29,21 +26,18 @@ func TestGetTags(t *testing.T) {
|
||||
{
|
||||
testName: "should return no tags if there are none",
|
||||
runner: oscommands.NewFakeRunner(t).
|
||||
Expect(`git tag --list --sort=-creatordate`, "", nil),
|
||||
Expect(`git tag --list -n --sort=-creatordate`, "", nil),
|
||||
expectedTags: []*models.Tag{},
|
||||
expectedError: nil,
|
||||
},
|
||||
{
|
||||
testName: "should return tags if present",
|
||||
runner: oscommands.NewFakeRunner(t).
|
||||
Expect(`git tag --list --sort=-creatordate`, tagsOutput, nil),
|
||||
Expect(`git tag --list -n --sort=-creatordate`, tagsOutput, nil),
|
||||
expectedTags: []*models.Tag{
|
||||
{Name: "v0.34"},
|
||||
{Name: "v0.33"},
|
||||
{Name: "v0.32.2"},
|
||||
{Name: "v0.32.1"},
|
||||
{Name: "v0.32"},
|
||||
{Name: "testtag"},
|
||||
{Name: "tag1", Message: "this is my message"},
|
||||
{Name: "tag2", Message: ""},
|
||||
{Name: "tag3", Message: "this is my other message"},
|
||||
},
|
||||
expectedError: nil,
|
||||
},
|
||||
|
@ -3,6 +3,9 @@ package models
|
||||
// Tag : A git tag
|
||||
type Tag struct {
|
||||
Name string
|
||||
// this is either the first line of the message of an annotated tag, or the
|
||||
// first line of a commit message for a lightweight tag
|
||||
Message string
|
||||
}
|
||||
|
||||
func (t *Tag) FullRefName() string {
|
||||
@ -22,5 +25,5 @@ func (t *Tag) ID() string {
|
||||
}
|
||||
|
||||
func (t *Tag) Description() string {
|
||||
return "tag " + t.Name
|
||||
return t.Message
|
||||
}
|
||||
|
@ -258,7 +258,7 @@ type KeybindingCommitsConfig struct {
|
||||
CherryPickCopy string `yaml:"cherryPickCopy"`
|
||||
CherryPickCopyRange string `yaml:"cherryPickCopyRange"`
|
||||
PasteCommits string `yaml:"pasteCommits"`
|
||||
TagCommit string `yaml:"tagCommit"`
|
||||
CreateTag string `yaml:"tagCommit"`
|
||||
CheckoutCommit string `yaml:"checkoutCommit"`
|
||||
ResetCherryPick string `yaml:"resetCherryPick"`
|
||||
CopyCommitAttributeToClipboard string `yaml:"copyCommitAttributeToClipboard"`
|
||||
@ -544,7 +544,7 @@ func GetDefaultConfig() *UserConfig {
|
||||
CherryPickCopy: "c",
|
||||
CherryPickCopyRange: "C",
|
||||
PasteCommits: "v",
|
||||
TagCommit: "T",
|
||||
CreateTag: "T",
|
||||
CheckoutCommit: "<space>",
|
||||
ResetCherryPick: "<c-R>",
|
||||
CopyCommitAttributeToClipboard: "y",
|
||||
|
@ -132,7 +132,7 @@ func (self *LocalCommitsController) GetKeybindings(opts types.KeybindingsOpts) [
|
||||
Description: self.c.Tr.LcRevertCommit,
|
||||
},
|
||||
{
|
||||
Key: opts.GetKey(opts.Config.Commits.TagCommit),
|
||||
Key: opts.GetKey(opts.Config.Commits.CreateTag),
|
||||
Handler: self.checkSelected(self.createTag),
|
||||
Description: self.c.Tr.LcTagCommit,
|
||||
},
|
||||
|
@ -4,6 +4,7 @@ import (
|
||||
"github.com/jesseduffield/generics/slices"
|
||||
"github.com/jesseduffield/lazygit/pkg/commands/models"
|
||||
"github.com/jesseduffield/lazygit/pkg/gui/presentation/icons"
|
||||
"github.com/jesseduffield/lazygit/pkg/gui/style"
|
||||
"github.com/jesseduffield/lazygit/pkg/theme"
|
||||
)
|
||||
|
||||
@ -24,6 +25,7 @@ func getTagDisplayStrings(t *models.Tag, diffed bool) []string {
|
||||
if icons.IsIconEnabled() {
|
||||
res = append(res, textStyle.Sprint(icons.IconForTag(t)))
|
||||
}
|
||||
res = append(res, textStyle.Sprint(t.Name))
|
||||
descriptionColor := style.FgYellow
|
||||
res = append(res, textStyle.Sprint(t.Name), descriptionColor.Sprint(t.Description()))
|
||||
return res
|
||||
}
|
||||
|
@ -985,7 +985,7 @@ func EnglishTranslationSet() TranslationSet {
|
||||
LcTagCommit: "tag commit",
|
||||
TagMenuTitle: "Create tag",
|
||||
TagNameTitle: "Tag name:",
|
||||
TagMessageTitle: "Tag message: ",
|
||||
TagMessageTitle: "Tag message:",
|
||||
LcAnnotatedTag: "annotated tag",
|
||||
LcLightweightTag: "lightweight tag",
|
||||
LcDeleteTag: "delete tag",
|
||||
|
@ -136,6 +136,10 @@ func (self *Shell) EmptyCommit(message string) *Shell {
|
||||
return self.RunCommand(fmt.Sprintf("git commit --allow-empty -m \"%s\"", message))
|
||||
}
|
||||
|
||||
func (self *Shell) CreateLightweightTag(name string, ref string) *Shell {
|
||||
return self.RunCommand(fmt.Sprintf("git tag %s %s", name, ref))
|
||||
}
|
||||
|
||||
// convenience method for creating a file and adding it
|
||||
func (self *Shell) CreateFileAndAdd(fileName string, fileContents string) *Shell {
|
||||
return self.
|
||||
|
@ -28,6 +28,7 @@ var CreateTag = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
|
||||
t.ExpectPopup().Menu().
|
||||
Title(Equals("Create tag")).
|
||||
Select(Contains("lightweight")).
|
||||
Confirm()
|
||||
|
||||
t.ExpectPopup().Prompt().
|
||||
|
@ -20,18 +20,42 @@ var Commit = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
|
||||
t.Views().Files().
|
||||
IsFocused().
|
||||
Lines(
|
||||
Contains("?? myfile").IsSelected(),
|
||||
Contains("?? myfile2"),
|
||||
).
|
||||
PressPrimaryAction(). // stage file
|
||||
Lines(
|
||||
Contains("A myfile").IsSelected(),
|
||||
Contains("?? myfile2"),
|
||||
).
|
||||
SelectNextItem().
|
||||
PressPrimaryAction(). // stage other file
|
||||
Lines(
|
||||
Contains("A myfile"),
|
||||
Contains("A myfile2").IsSelected(),
|
||||
).
|
||||
Press(keys.Files.CommitChanges)
|
||||
|
||||
commitMessage := "my commit message"
|
||||
|
||||
t.ExpectPopup().CommitMessagePanel().Type(commitMessage).Confirm()
|
||||
|
||||
t.Views().Files().
|
||||
IsEmpty()
|
||||
|
||||
t.Views().Commits().
|
||||
Focus().
|
||||
Lines(
|
||||
Contains(commitMessage),
|
||||
Contains(commitMessage).IsSelected(),
|
||||
).
|
||||
PressEnter()
|
||||
|
||||
t.Views().CommitFiles().
|
||||
IsFocused().
|
||||
Lines(
|
||||
Contains("A myfile"),
|
||||
Contains("A myfile2"),
|
||||
)
|
||||
},
|
||||
})
|
||||
|
51
pkg/integration/tests/commit/create_tag.go
Normal file
51
pkg/integration/tests/commit/create_tag.go
Normal file
@ -0,0 +1,51 @@
|
||||
package commit
|
||||
|
||||
import (
|
||||
"github.com/jesseduffield/lazygit/pkg/config"
|
||||
. "github.com/jesseduffield/lazygit/pkg/integration/components"
|
||||
)
|
||||
|
||||
var CreateTag = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
Description: "Create a new tag on a commit",
|
||||
ExtraCmdArgs: "",
|
||||
Skip: false,
|
||||
SetupConfig: func(config *config.AppConfig) {},
|
||||
SetupRepo: func(shell *Shell) {
|
||||
shell.EmptyCommit("one")
|
||||
shell.EmptyCommit("two")
|
||||
},
|
||||
Run: func(t *TestDriver, keys config.KeybindingConfig) {
|
||||
t.Views().Commits().
|
||||
Focus().
|
||||
Lines(
|
||||
Contains("two").IsSelected(),
|
||||
Contains("one"),
|
||||
).
|
||||
Press(keys.Commits.CreateTag)
|
||||
|
||||
t.ExpectPopup().Menu().
|
||||
Title(Equals("Create tag")).
|
||||
Select(Contains("lightweight")).
|
||||
Confirm()
|
||||
|
||||
t.ExpectPopup().Prompt().
|
||||
Title(Equals("Tag name:")).
|
||||
Type("new-tag").
|
||||
Confirm()
|
||||
|
||||
t.Views().Commits().
|
||||
Lines(
|
||||
MatchesRegexp(`new-tag.*two`).IsSelected(),
|
||||
MatchesRegexp(`one`),
|
||||
)
|
||||
|
||||
t.Views().Tags().
|
||||
Focus().
|
||||
Lines(
|
||||
MatchesRegexp(`new-tag.*two`).IsSelected(),
|
||||
)
|
||||
|
||||
t.Git().
|
||||
TagNamesAt("HEAD", []string{"new-tag"})
|
||||
},
|
||||
})
|
31
pkg/integration/tests/tag/checkout.go
Normal file
31
pkg/integration/tests/tag/checkout.go
Normal file
@ -0,0 +1,31 @@
|
||||
package tag
|
||||
|
||||
import (
|
||||
"github.com/jesseduffield/lazygit/pkg/config"
|
||||
. "github.com/jesseduffield/lazygit/pkg/integration/components"
|
||||
)
|
||||
|
||||
var Checkout = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
Description: "Checkout a tag",
|
||||
ExtraCmdArgs: "",
|
||||
Skip: false,
|
||||
SetupConfig: func(config *config.AppConfig) {},
|
||||
SetupRepo: func(shell *Shell) {
|
||||
shell.EmptyCommit("one")
|
||||
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(
|
||||
Contains("HEAD detached at tag").IsSelected(),
|
||||
Contains("master"),
|
||||
)
|
||||
},
|
||||
})
|
49
pkg/integration/tests/tag/crud_annotated.go
Normal file
49
pkg/integration/tests/tag/crud_annotated.go
Normal file
@ -0,0 +1,49 @@
|
||||
package tag
|
||||
|
||||
import (
|
||||
"github.com/jesseduffield/lazygit/pkg/config"
|
||||
. "github.com/jesseduffield/lazygit/pkg/integration/components"
|
||||
)
|
||||
|
||||
var CrudAnnotated = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
Description: "Create and delete an annotated tag in the tags panel",
|
||||
ExtraCmdArgs: "",
|
||||
Skip: false,
|
||||
SetupConfig: func(config *config.AppConfig) {},
|
||||
SetupRepo: func(shell *Shell) {
|
||||
shell.EmptyCommit("initial commit")
|
||||
},
|
||||
Run: func(t *TestDriver, keys config.KeybindingConfig) {
|
||||
t.Views().Tags().
|
||||
Focus().
|
||||
IsEmpty().
|
||||
Press(keys.Universal.New).
|
||||
Tap(func() {
|
||||
t.ExpectPopup().Menu().
|
||||
Title(Equals("Create tag")).
|
||||
Select(Contains("annotated")).
|
||||
Confirm()
|
||||
|
||||
t.ExpectPopup().Prompt().
|
||||
Title(Equals("Tag name:")).
|
||||
Type("new-tag").
|
||||
Confirm()
|
||||
|
||||
t.ExpectPopup().Prompt().
|
||||
Title(Equals("Tag message:")).
|
||||
Type("message").
|
||||
Confirm()
|
||||
}).
|
||||
Lines(
|
||||
MatchesRegexp(`new-tag.*message`).IsSelected(),
|
||||
).
|
||||
Press(keys.Universal.Remove).
|
||||
Tap(func() {
|
||||
t.ExpectPopup().Confirmation().
|
||||
Title(Equals("Delete tag")).
|
||||
Content(Equals("Are you sure you want to delete tag 'new-tag'?")).
|
||||
Confirm()
|
||||
}).
|
||||
IsEmpty()
|
||||
},
|
||||
})
|
53
pkg/integration/tests/tag/crud_lightweight.go
Normal file
53
pkg/integration/tests/tag/crud_lightweight.go
Normal file
@ -0,0 +1,53 @@
|
||||
package tag
|
||||
|
||||
import (
|
||||
"github.com/jesseduffield/lazygit/pkg/config"
|
||||
. "github.com/jesseduffield/lazygit/pkg/integration/components"
|
||||
)
|
||||
|
||||
var CrudLightweight = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
Description: "Create and delete a lightweight tag in the tags panel",
|
||||
ExtraCmdArgs: "",
|
||||
Skip: false,
|
||||
SetupConfig: func(config *config.AppConfig) {},
|
||||
SetupRepo: func(shell *Shell) {
|
||||
shell.EmptyCommit("initial commit")
|
||||
},
|
||||
Run: func(t *TestDriver, keys config.KeybindingConfig) {
|
||||
t.Views().Tags().
|
||||
Focus().
|
||||
IsEmpty().
|
||||
Press(keys.Universal.New).
|
||||
Tap(func() {
|
||||
t.ExpectPopup().Menu().
|
||||
Title(Equals("Create tag")).
|
||||
Select(Contains("lightweight")).
|
||||
Confirm()
|
||||
|
||||
t.ExpectPopup().Prompt().
|
||||
Title(Equals("Tag name:")).
|
||||
Type("new-tag").
|
||||
Confirm()
|
||||
}).
|
||||
Lines(
|
||||
MatchesRegexp(`new-tag.*initial commit`).IsSelected(),
|
||||
).
|
||||
PressEnter().
|
||||
Tap(func() {
|
||||
// view the commits of the tag
|
||||
t.Views().SubCommits().IsFocused().
|
||||
Lines(
|
||||
Contains("initial commit"),
|
||||
).
|
||||
PressEscape()
|
||||
}).
|
||||
Press(keys.Universal.Remove).
|
||||
Tap(func() {
|
||||
t.ExpectPopup().Confirmation().
|
||||
Title(Equals("Delete tag")).
|
||||
Content(Equals("Are you sure you want to delete tag 'new-tag'?")).
|
||||
Confirm()
|
||||
}).
|
||||
IsEmpty()
|
||||
},
|
||||
})
|
40
pkg/integration/tests/tag/reset.go
Normal file
40
pkg/integration/tests/tag/reset.go
Normal file
@ -0,0 +1,40 @@
|
||||
package tag
|
||||
|
||||
import (
|
||||
"github.com/jesseduffield/lazygit/pkg/config"
|
||||
. "github.com/jesseduffield/lazygit/pkg/integration/components"
|
||||
)
|
||||
|
||||
var Reset = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
Description: "Hard reset to a tag",
|
||||
ExtraCmdArgs: "",
|
||||
Skip: false,
|
||||
SetupConfig: func(config *config.AppConfig) {},
|
||||
SetupRepo: func(shell *Shell) {
|
||||
shell.EmptyCommit("one")
|
||||
shell.EmptyCommit("two")
|
||||
shell.CreateLightweightTag("tag", "HEAD^") // creating tag on commit "one"
|
||||
},
|
||||
Run: func(t *TestDriver, keys config.KeybindingConfig) {
|
||||
t.Views().Commits().Lines(
|
||||
Contains("two"),
|
||||
Contains("one"),
|
||||
)
|
||||
|
||||
t.Views().Tags().
|
||||
Focus().
|
||||
Lines(
|
||||
Contains("tag").IsSelected(),
|
||||
).
|
||||
Press(keys.Commits.ViewResetOptions)
|
||||
|
||||
t.ExpectPopup().Menu().
|
||||
Title(Contains("reset to tag")).
|
||||
Select(Contains("hard reset")).
|
||||
Confirm()
|
||||
|
||||
t.Views().Commits().Lines(
|
||||
Contains("one"),
|
||||
)
|
||||
},
|
||||
})
|
@ -20,6 +20,7 @@ import (
|
||||
"github.com/jesseduffield/lazygit/pkg/integration/tests/stash"
|
||||
"github.com/jesseduffield/lazygit/pkg/integration/tests/submodule"
|
||||
"github.com/jesseduffield/lazygit/pkg/integration/tests/sync"
|
||||
"github.com/jesseduffield/lazygit/pkg/integration/tests/tag"
|
||||
"github.com/jesseduffield/lazygit/pkg/integration/tests/undo"
|
||||
)
|
||||
|
||||
@ -40,6 +41,7 @@ var tests = []*components.IntegrationTest{
|
||||
cherry_pick.CherryPickConflicts,
|
||||
commit.Commit,
|
||||
commit.CommitMultiline,
|
||||
commit.CreateTag,
|
||||
commit.DiscardOldFileChange,
|
||||
commit.NewBranch,
|
||||
commit.Revert,
|
||||
@ -85,5 +87,10 @@ var tests = []*components.IntegrationTest{
|
||||
sync.Pull,
|
||||
sync.PullAndSetUpstream,
|
||||
sync.RenameBranchAndPull,
|
||||
tag.Checkout,
|
||||
tag.CrudAnnotated,
|
||||
tag.CrudLightweight,
|
||||
tag.Reset,
|
||||
undo.UndoCheckoutAndDrop,
|
||||
undo.UndoDrop,
|
||||
}
|
||||
|
151
pkg/integration/tests/undo/undo_checkout_and_drop.go
Normal file
151
pkg/integration/tests/undo/undo_checkout_and_drop.go
Normal file
@ -0,0 +1,151 @@
|
||||
package undo
|
||||
|
||||
import (
|
||||
"github.com/jesseduffield/lazygit/pkg/config"
|
||||
. "github.com/jesseduffield/lazygit/pkg/integration/components"
|
||||
)
|
||||
|
||||
var UndoCheckoutAndDrop = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
Description: "Drop some commits and then undo/redo the actions",
|
||||
ExtraCmdArgs: "",
|
||||
Skip: false,
|
||||
SetupConfig: func(config *config.AppConfig) {},
|
||||
SetupRepo: func(shell *Shell) {
|
||||
shell.EmptyCommit("one")
|
||||
shell.EmptyCommit("two")
|
||||
shell.EmptyCommit("three")
|
||||
shell.EmptyCommit("four")
|
||||
|
||||
shell.NewBranch("other_branch")
|
||||
shell.Checkout("master")
|
||||
},
|
||||
Run: func(t *TestDriver, keys config.KeybindingConfig) {
|
||||
// we're going to drop a commit, switch branch, drop a commit there, then undo everything, then redo everything.
|
||||
|
||||
confirmCommitDrop := func() {
|
||||
t.ExpectPopup().Confirmation().
|
||||
Title(Equals("Delete Commit")).
|
||||
Content(Equals("Are you sure you want to delete this commit?")).
|
||||
Confirm()
|
||||
}
|
||||
|
||||
confirmUndoDrop := func() {
|
||||
t.ExpectPopup().Confirmation().
|
||||
Title(Equals("Undo")).
|
||||
Content(MatchesRegexp(`Are you sure you want to hard reset to '.*'\? An auto-stash will be performed if necessary\.`)).
|
||||
Confirm()
|
||||
}
|
||||
|
||||
confirmRedoDrop := func() {
|
||||
t.ExpectPopup().Confirmation().
|
||||
Title(Equals("Redo")).
|
||||
Content(MatchesRegexp(`Are you sure you want to hard reset to '.*'\? An auto-stash will be performed if necessary\.`)).
|
||||
Confirm()
|
||||
}
|
||||
|
||||
t.Views().Commits().Focus().
|
||||
Lines(
|
||||
Contains("four").IsSelected(),
|
||||
Contains("three"),
|
||||
Contains("two"),
|
||||
Contains("one"),
|
||||
).
|
||||
Press(keys.Universal.Remove).
|
||||
Tap(confirmCommitDrop).
|
||||
Lines(
|
||||
Contains("three").IsSelected(),
|
||||
Contains("two"),
|
||||
Contains("one"),
|
||||
)
|
||||
|
||||
t.Views().Branches().Focus().
|
||||
Lines(
|
||||
Contains("master").IsSelected(),
|
||||
Contains("other_branch"),
|
||||
).
|
||||
SelectNextItem().
|
||||
// checkout branch
|
||||
PressPrimaryAction().
|
||||
Lines(
|
||||
Contains("other_branch").IsSelected(),
|
||||
Contains("master"),
|
||||
)
|
||||
|
||||
// drop the commit in the 'other_branch' branch too
|
||||
t.Views().Commits().Focus().
|
||||
Lines(
|
||||
Contains("four").IsSelected(),
|
||||
Contains("three"),
|
||||
Contains("two"),
|
||||
Contains("one"),
|
||||
).
|
||||
Press(keys.Universal.Remove).
|
||||
Tap(confirmCommitDrop).
|
||||
Lines(
|
||||
Contains("three").IsSelected(),
|
||||
Contains("two"),
|
||||
Contains("one"),
|
||||
).
|
||||
Press(keys.Universal.Undo).
|
||||
Tap(confirmUndoDrop).
|
||||
Lines(
|
||||
Contains("four").IsSelected(),
|
||||
Contains("three"),
|
||||
Contains("two"),
|
||||
Contains("one"),
|
||||
).
|
||||
Press(keys.Universal.Undo).
|
||||
Tap(func() {
|
||||
t.ExpectPopup().Confirmation().
|
||||
Title(Equals("Undo")).
|
||||
Content(Contains("Are you sure you want to checkout 'master'?")).
|
||||
Confirm()
|
||||
|
||||
t.Views().Branches().
|
||||
Lines(
|
||||
Contains("master").IsSelected(),
|
||||
Contains("other_branch"),
|
||||
)
|
||||
}).
|
||||
Lines(
|
||||
Contains("three").IsSelected(),
|
||||
Contains("two"),
|
||||
Contains("one"),
|
||||
).
|
||||
Press(keys.Universal.Undo).
|
||||
Tap(confirmUndoDrop).
|
||||
Lines(
|
||||
Contains("four").IsSelected(),
|
||||
Contains("three"),
|
||||
Contains("two"),
|
||||
Contains("one"),
|
||||
).
|
||||
Press(keys.Universal.Redo).
|
||||
Tap(confirmRedoDrop).
|
||||
Lines(
|
||||
Contains("three").IsSelected(),
|
||||
Contains("two"),
|
||||
Contains("one"),
|
||||
).
|
||||
Press(keys.Universal.Redo).
|
||||
Tap(func() {
|
||||
t.ExpectPopup().Confirmation().
|
||||
Title(Equals("Redo")).
|
||||
Content(Contains("Are you sure you want to checkout 'other_branch'?")).
|
||||
Confirm()
|
||||
|
||||
t.Views().Branches().
|
||||
Lines(
|
||||
Contains("other_branch").IsSelected(),
|
||||
Contains("master"),
|
||||
)
|
||||
}).
|
||||
Press(keys.Universal.Redo).
|
||||
Tap(confirmRedoDrop).
|
||||
Lines(
|
||||
Contains("three").IsSelected(),
|
||||
Contains("two"),
|
||||
Contains("one"),
|
||||
)
|
||||
},
|
||||
})
|
@ -1 +0,0 @@
|
||||
file1
|
@ -1 +0,0 @@
|
||||
ref: refs/heads/master
|
@ -1,10 +0,0 @@
|
||||
[core]
|
||||
repositoryformatversion = 0
|
||||
filemode = true
|
||||
bare = false
|
||||
logallrefupdates = true
|
||||
ignorecase = true
|
||||
precomposeunicode = true
|
||||
[user]
|
||||
email = CI@example.com
|
||||
name = CI
|
@ -1 +0,0 @@
|
||||
Unnamed repository; edit this file 'description' to name the repository.
|
Binary file not shown.
@ -1,7 +0,0 @@
|
||||
# git ls-files --others --exclude-from=.git/info/exclude
|
||||
# Lines that start with '#' are comments.
|
||||
# For a project mostly in C, the following would be a good set of
|
||||
# exclude patterns (uncomment them if you want to use them):
|
||||
# *.[oa]
|
||||
# *~
|
||||
.DS_Store
|
@ -1,2 +0,0 @@
|
||||
0000000000000000000000000000000000000000 3e46e87f3ca37fad40d7dd6aca00223d7f49e424 CI <CI@example.com> 1631477191 -0300 commit (initial): file0
|
||||
3e46e87f3ca37fad40d7dd6aca00223d7f49e424 07b4cadb018ce914237e3f31ee264c9555acc1d1 CI <CI@example.com> 1631477191 -0300 commit: file1
|
@ -1,2 +0,0 @@
|
||||
0000000000000000000000000000000000000000 3e46e87f3ca37fad40d7dd6aca00223d7f49e424 CI <CI@example.com> 1631477191 -0300 commit (initial): file0
|
||||
3e46e87f3ca37fad40d7dd6aca00223d7f49e424 07b4cadb018ce914237e3f31ee264c9555acc1d1 CI <CI@example.com> 1631477191 -0300 commit: file1
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,2 +0,0 @@
|
||||
x�’É®›@E³æ+zo%4ƒ¤$
|
||||
`ÀŒ¶aG3?ÀŒÆ†¯�“(»,RË£Ò½ªÒIº¶fÀ‘Ô§yÌ2@dTÆ°ˆçù{–‰S"Ë ‡r:‡$Js’Ïhž¦I,~Ìe7I_%íGöŠÛ¾É¾$]ûEÐ,Kðø)±7}—ÌÙ®}1UøükDYÕlà¨ð4Õüà,ÿæÀ@媛(¢$©RÉ2iy¬è›ƒBï©"Ø—ácUe�V„VÞÝ’D�ŠÚýË1 ë{Ë>…uPV´vmQÐ)Q«‡\"qúLVp§ú7üÁ]žãÈDãÕÚ5Í©|V–#J…Ú,BÌ•¬èšù È:™7÷Wk¨Õ£h†ÕgË¢TÓv×EÍÆ—�ëY/ú!#H1Àšïßv�·ëÅJVÓµ`2½¿z§\P5ººVC�±¥Ž{oÞqáQ��ø¡ÛOˆ®!Ê{rÓòô�ønhâDVL®Ä)r‹ÕªmÕ2„1Z熩ú©åÄ%ˆÁÌCï„!8/Lœ‘§VZ^Wîf¢ÍẎ+Ï7¾wOA-…eÇ‘›|<&á>دû¼:\I].Ûqƒ>j‡âèÓ¡éÕ¦x§úÞ{áÊK–ßCÆ[§€ZìÂaí3sd•!æ©—Çjõ)lÆ°-nn£ÛCÂ5�[¯aË_!{ÀŸ¦�4:‡§ÖêCÓ|7í·Ñ¤²îa$:PMÞ÷p‡2IèSφe]©7|R;C»Twþ|LÉIG´tÍûF“ý¾Í‰²d"F{'”ç⥶ÃÀ·£#Øeûð/±¼j2ˆý¹AK
|
Binary file not shown.
@ -1,2 +0,0 @@
|
||||
x+)JMU03c040031QHヒフI5`ーアコイ燹ヨカwチ�w.ス��モ[H
|
||||
矢y�5�来ミ(桍ァ^-ンW(x9
|
@ -1 +0,0 @@
|
||||
# pack-refs with: peeled fully-peeled sorted
|
@ -1 +0,0 @@
|
||||
07b4cadb018ce914237e3f31ee264c9555acc1d1
|
@ -1 +0,0 @@
|
||||
07b4cadb018ce914237e3f31ee264c9555acc1d1
|
@ -1 +0,0 @@
|
||||
07b4cadb018ce914237e3f31ee264c9555acc1d1
|
@ -1 +0,0 @@
|
||||
3e46e87f3ca37fad40d7dd6aca00223d7f49e424
|
@ -1 +0,0 @@
|
||||
test0
|
@ -1 +0,0 @@
|
||||
test1
|
@ -1 +0,0 @@
|
||||
{"KeyEvents":[{"Timestamp":2009,"Mod":0,"Key":256,"Ch":52},{"Timestamp":2895,"Mod":0,"Key":256,"Ch":84},{"Timestamp":3851,"Mod":0,"Key":13,"Ch":13},{"Timestamp":4233,"Mod":0,"Key":256,"Ch":116},{"Timestamp":4248,"Mod":0,"Key":256,"Ch":97},{"Timestamp":4436,"Mod":0,"Key":256,"Ch":103},{"Timestamp":4618,"Mod":0,"Key":256,"Ch":49},{"Timestamp":4751,"Mod":0,"Key":13,"Ch":13},{"Timestamp":7572,"Mod":0,"Key":256,"Ch":84},{"Timestamp":7946,"Mod":0,"Key":13,"Ch":13},{"Timestamp":8457,"Mod":0,"Key":256,"Ch":116},{"Timestamp":8491,"Mod":0,"Key":256,"Ch":97},{"Timestamp":8665,"Mod":0,"Key":256,"Ch":103},{"Timestamp":8884,"Mod":0,"Key":256,"Ch":51},{"Timestamp":9219,"Mod":0,"Key":13,"Ch":13},{"Timestamp":13521,"Mod":0,"Key":256,"Ch":84},{"Timestamp":15106,"Mod":0,"Key":13,"Ch":13},{"Timestamp":15579,"Mod":0,"Key":256,"Ch":116},{"Timestamp":15604,"Mod":0,"Key":256,"Ch":97},{"Timestamp":15858,"Mod":0,"Key":256,"Ch":103},{"Timestamp":16298,"Mod":0,"Key":256,"Ch":50},{"Timestamp":16600,"Mod":0,"Key":13,"Ch":13},{"Timestamp":19216,"Mod":0,"Key":258,"Ch":0},{"Timestamp":19753,"Mod":0,"Key":256,"Ch":84},{"Timestamp":20673,"Mod":0,"Key":13,"Ch":13},{"Timestamp":20918,"Mod":0,"Key":256,"Ch":116},{"Timestamp":20990,"Mod":0,"Key":256,"Ch":97},{"Timestamp":21124,"Mod":0,"Key":256,"Ch":103},{"Timestamp":21361,"Mod":0,"Key":256,"Ch":52},{"Timestamp":22463,"Mod":0,"Key":13,"Ch":13},{"Timestamp":23552,"Mod":0,"Key":256,"Ch":51},{"Timestamp":23909,"Mod":0,"Key":256,"Ch":93},{"Timestamp":24078,"Mod":0,"Key":256,"Ch":93},{"Timestamp":25170,"Mod":0,"Key":258,"Ch":0},{"Timestamp":25510,"Mod":0,"Key":256,"Ch":100},{"Timestamp":26316,"Mod":0,"Key":13,"Ch":13},{"Timestamp":28199,"Mod":0,"Key":256,"Ch":113}],"ResizeEvents":[{"Timestamp":0,"Width":131,"Height":42}]}
|
@ -1,18 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
cd $1
|
||||
|
||||
git init
|
||||
|
||||
git config user.email "CI@example.com"
|
||||
git config user.name "CI"
|
||||
|
||||
echo test0 > file0
|
||||
git add .
|
||||
git commit -am file0
|
||||
|
||||
echo test1 > file1
|
||||
git add .
|
||||
git commit -am file1
|
@ -1 +0,0 @@
|
||||
{ "description": "basic CRUD for tags", "speed": 5 }
|
@ -1 +0,0 @@
|
||||
file4
|
@ -1 +0,0 @@
|
||||
aefe968910ad84a58bfac631b56eb422968766fb
|
@ -1 +0,0 @@
|
||||
aefe968910ad84a58bfac631b56eb422968766fb
|
@ -1,10 +0,0 @@
|
||||
[core]
|
||||
repositoryformatversion = 0
|
||||
filemode = true
|
||||
bare = false
|
||||
logallrefupdates = true
|
||||
ignorecase = true
|
||||
precomposeunicode = true
|
||||
[user]
|
||||
email = CI@example.com
|
||||
name = CI
|
@ -1 +0,0 @@
|
||||
Unnamed repository; edit this file 'description' to name the repository.
|
Binary file not shown.
@ -1,7 +0,0 @@
|
||||
# git ls-files --others --exclude-from=.git/info/exclude
|
||||
# Lines that start with '#' are comments.
|
||||
# For a project mostly in C, the following would be a good set of
|
||||
# exclude patterns (uncomment them if you want to use them):
|
||||
# *.[oa]
|
||||
# *~
|
||||
.DS_Store
|
@ -1,5 +0,0 @@
|
||||
0000000000000000000000000000000000000000 dcb11a2a23383bd5f4a1085bf3a64e73e5bd963a CI <CI@example.com> 1631477400 -0300 commit (initial): file0
|
||||
dcb11a2a23383bd5f4a1085bf3a64e73e5bd963a 56a89d6aebdfa4f2d717efc0d115656cc9b602e7 CI <CI@example.com> 1631477401 -0300 commit: file1
|
||||
56a89d6aebdfa4f2d717efc0d115656cc9b602e7 aefe968910ad84a58bfac631b56eb422968766fb CI <CI@example.com> 1631477401 -0300 commit: file2
|
||||
aefe968910ad84a58bfac631b56eb422968766fb 1750e9a4016c985ef97d002ae40ed554e3db6c87 CI <CI@example.com> 1631477401 -0300 commit: file4
|
||||
1750e9a4016c985ef97d002ae40ed554e3db6c87 aefe968910ad84a58bfac631b56eb422968766fb CI <CI@example.com> 1631477414 -0300 checkout: moving from master to one
|
@ -1,4 +0,0 @@
|
||||
0000000000000000000000000000000000000000 dcb11a2a23383bd5f4a1085bf3a64e73e5bd963a CI <CI@example.com> 1631477400 -0300 commit (initial): file0
|
||||
dcb11a2a23383bd5f4a1085bf3a64e73e5bd963a 56a89d6aebdfa4f2d717efc0d115656cc9b602e7 CI <CI@example.com> 1631477401 -0300 commit: file1
|
||||
56a89d6aebdfa4f2d717efc0d115656cc9b602e7 aefe968910ad84a58bfac631b56eb422968766fb CI <CI@example.com> 1631477401 -0300 commit: file2
|
||||
aefe968910ad84a58bfac631b56eb422968766fb 1750e9a4016c985ef97d002ae40ed554e3db6c87 CI <CI@example.com> 1631477401 -0300 commit: file4
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,2 +0,0 @@
|
||||
x+)JMU03c040031QHヒフI5`ーアコイ燹ヨカwチ�w.ス��モ[H
|
||||
矢y�5�来ミ(桍ァ^-ンW(x9
|
Binary file not shown.
Binary file not shown.
@ -1 +0,0 @@
|
||||
1750e9a4016c985ef97d002ae40ed554e3db6c87
|
@ -1 +0,0 @@
|
||||
aefe968910ad84a58bfac631b56eb422968766fb
|
@ -1 +0,0 @@
|
||||
56a89d6aebdfa4f2d717efc0d115656cc9b602e7
|
@ -1 +0,0 @@
|
||||
test0
|
@ -1 +0,0 @@
|
||||
test1
|
@ -1 +0,0 @@
|
||||
test2
|
@ -1 +0,0 @@
|
||||
{"KeyEvents":[{"Timestamp":325,"Mod":0,"Key":256,"Ch":52},{"Timestamp":688,"Mod":0,"Key":256,"Ch":106},{"Timestamp":1081,"Mod":0,"Key":256,"Ch":84},{"Timestamp":1671,"Mod":0,"Key":13,"Ch":13},{"Timestamp":2002,"Mod":0,"Key":256,"Ch":111},{"Timestamp":2100,"Mod":0,"Key":256,"Ch":110},{"Timestamp":2164,"Mod":0,"Key":256,"Ch":101},{"Timestamp":2243,"Mod":0,"Key":13,"Ch":13},{"Timestamp":2850,"Mod":0,"Key":256,"Ch":106},{"Timestamp":3524,"Mod":0,"Key":256,"Ch":84},{"Timestamp":4057,"Mod":0,"Key":13,"Ch":13},{"Timestamp":4418,"Mod":0,"Key":256,"Ch":116},{"Timestamp":4482,"Mod":0,"Key":256,"Ch":119},{"Timestamp":4509,"Mod":0,"Key":256,"Ch":111},{"Timestamp":4836,"Mod":0,"Key":13,"Ch":13},{"Timestamp":7822,"Mod":0,"Key":256,"Ch":107},{"Timestamp":8408,"Mod":0,"Key":256,"Ch":103},{"Timestamp":10049,"Mod":0,"Key":27,"Ch":0},{"Timestamp":10619,"Mod":0,"Key":256,"Ch":51},{"Timestamp":11391,"Mod":0,"Key":256,"Ch":93},{"Timestamp":11573,"Mod":0,"Key":256,"Ch":93},{"Timestamp":13390,"Mod":0,"Key":256,"Ch":32},{"Timestamp":16819,"Mod":0,"Key":256,"Ch":93},{"Timestamp":16985,"Mod":0,"Key":256,"Ch":93},{"Timestamp":17905,"Mod":0,"Key":256,"Ch":103},{"Timestamp":20817,"Mod":0,"Key":13,"Ch":13},{"Timestamp":25557,"Mod":0,"Key":256,"Ch":50},{"Timestamp":25951,"Mod":0,"Key":256,"Ch":49},{"Timestamp":26265,"Mod":0,"Key":256,"Ch":51},{"Timestamp":26990,"Mod":0,"Key":256,"Ch":91},{"Timestamp":27245,"Mod":0,"Key":256,"Ch":91},{"Timestamp":28363,"Mod":0,"Key":256,"Ch":113}],"ResizeEvents":[{"Timestamp":0,"Width":131,"Height":42}]}
|
@ -1,26 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
cd $1
|
||||
|
||||
git init
|
||||
|
||||
git config user.email "CI@example.com"
|
||||
git config user.name "CI"
|
||||
|
||||
echo test0 > file0
|
||||
git add .
|
||||
git commit -am file0
|
||||
|
||||
echo test1 > file1
|
||||
git add .
|
||||
git commit -am file1
|
||||
|
||||
echo test2 > file2
|
||||
git add .
|
||||
git commit -am file2
|
||||
|
||||
echo test3 > file4
|
||||
git add .
|
||||
git commit -am file4
|
@ -1 +0,0 @@
|
||||
{ "description": "checking out and resetting to tags", "speed": 10 }
|
@ -1 +0,0 @@
|
||||
file4
|
@ -1 +0,0 @@
|
||||
ref: refs/heads/test
|
@ -1,10 +0,0 @@
|
||||
[core]
|
||||
repositoryformatversion = 0
|
||||
filemode = true
|
||||
bare = false
|
||||
logallrefupdates = true
|
||||
ignorecase = true
|
||||
precomposeunicode = true
|
||||
[user]
|
||||
email = CI@example.com
|
||||
name = CI
|
@ -1 +0,0 @@
|
||||
Unnamed repository; edit this file 'description' to name the repository.
|
Binary file not shown.
@ -1,7 +0,0 @@
|
||||
# git ls-files --others --exclude-from=.git/info/exclude
|
||||
# Lines that start with '#' are comments.
|
||||
# For a project mostly in C, the following would be a good set of
|
||||
# exclude patterns (uncomment them if you want to use them):
|
||||
# *.[oa]
|
||||
# *~
|
||||
.DS_Store
|
@ -1,5 +0,0 @@
|
||||
0000000000000000000000000000000000000000 46b4990797fac897fb135dd639a4cad3b0269f2d CI <CI@example.com> 1631477922 -0300 commit (initial): file0
|
||||
46b4990797fac897fb135dd639a4cad3b0269f2d 88d7a40883abd57297127b3777a2a7ec3696c33a CI <CI@example.com> 1631477922 -0300 commit: file1
|
||||
88d7a40883abd57297127b3777a2a7ec3696c33a 08c28e4e15f3de3b024524894d9235dfcdb48c19 CI <CI@example.com> 1631477922 -0300 commit: file2
|
||||
08c28e4e15f3de3b024524894d9235dfcdb48c19 2515eabac6791725f4a3326676a1491f09664afc CI <CI@example.com> 1631477922 -0300 commit: file4
|
||||
2515eabac6791725f4a3326676a1491f09664afc 88d7a40883abd57297127b3777a2a7ec3696c33a CI <CI@example.com> 1631477929 -0300 checkout: moving from master to test
|
@ -1,4 +0,0 @@
|
||||
0000000000000000000000000000000000000000 46b4990797fac897fb135dd639a4cad3b0269f2d CI <CI@example.com> 1631477922 -0300 commit (initial): file0
|
||||
46b4990797fac897fb135dd639a4cad3b0269f2d 88d7a40883abd57297127b3777a2a7ec3696c33a CI <CI@example.com> 1631477922 -0300 commit: file1
|
||||
88d7a40883abd57297127b3777a2a7ec3696c33a 08c28e4e15f3de3b024524894d9235dfcdb48c19 CI <CI@example.com> 1631477922 -0300 commit: file2
|
||||
08c28e4e15f3de3b024524894d9235dfcdb48c19 2515eabac6791725f4a3326676a1491f09664afc CI <CI@example.com> 1631477922 -0300 commit: file4
|
@ -1 +0,0 @@
|
||||
0000000000000000000000000000000000000000 88d7a40883abd57297127b3777a2a7ec3696c33a CI <CI@example.com> 1631477929 -0300 branch: Created from 88d7a40883abd57297127b3777a2a7ec3696c33a
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,2 +0,0 @@
|
||||
x+)JMU03c040031QHヒフI5`ーアコイ燹ヨカwチ�w.ス��モ[H
|
||||
矢y�5�来ミ(桍ァ^-ンW(x9
|
Binary file not shown.
@ -1 +0,0 @@
|
||||
2515eabac6791725f4a3326676a1491f09664afc
|
@ -1 +0,0 @@
|
||||
88d7a40883abd57297127b3777a2a7ec3696c33a
|
@ -1 +0,0 @@
|
||||
08c28e4e15f3de3b024524894d9235dfcdb48c19
|
@ -1 +0,0 @@
|
||||
test0
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user