1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-04-15 11:56:37 +02:00

migrate staging tests

This commit is contained in:
Jesse Duffield 2023-02-23 22:29:40 +11:00
parent 1b52a0d83f
commit c63fed2074
199 changed files with 540 additions and 2476 deletions

View File

@ -31,3 +31,10 @@ func (self *Actions) ContinueOnConflictsResolved() {
Content(Contains("all merge conflicts resolved. Continue?")).
Confirm()
}
func (self *Actions) ConfirmDiscardLines() {
self.t.ExpectPopup().Confirmation().
Title(Equals("Unstage lines")).
Content(Contains("Are you sure you want to delete the selected lines")).
Confirm()
}

View File

@ -28,7 +28,21 @@ func (self *CommitMessagePanelDriver) AddNewline() *CommitMessagePanelDriver {
}
func (self *CommitMessagePanelDriver) Clear() *CommitMessagePanelDriver {
panic("Clear method not yet implemented!")
// clearing multiple times in case there's multiple lines
// (the clear button only clears a single line at a time)
maxAttempts := 100
for i := 0; i < maxAttempts+1; i++ {
if self.getViewDriver().getView().Buffer() == "" {
break
}
self.t.press(ClearKey)
if i == maxAttempts {
panic("failed to clear commit message panel")
}
}
return self
}
func (self *CommitMessagePanelDriver) Confirm() {

View File

@ -37,6 +37,13 @@ func (self *TestDriver) press(keyStr string) {
self.gui.PressKey(keyStr)
}
// Should only be used in specific cases where you're doing something weird!
// E.g. invoking a global keybinding from within a popup.
// You probably shouldn't use this function, and should instead go through a view like t.Views().Commit().Focus().Press(...)
func (self *TestDriver) GlobalPress(keyStr string) {
self.press(keyStr)
}
func (self *TestDriver) typeContent(content string) {
for _, char := range content {
self.press(string(char))

View File

@ -0,0 +1,62 @@
package file
import (
"github.com/jesseduffield/lazygit/pkg/config"
. "github.com/jesseduffield/lazygit/pkg/integration/components"
)
var preCommitHook = `#!/bin/bash
if [[ -f bad ]]; then
exit 1
fi
`
var RememberCommitMessageAfterFail = NewIntegrationTest(NewIntegrationTestArgs{
Description: "Verify that the commit message is remembered after a failed attempt at committing",
ExtraCmdArgs: "",
Skip: false,
SetupConfig: func(config *config.AppConfig) {
},
SetupRepo: func(shell *Shell) {
shell.CreateFile(".git/hooks/pre-commit", preCommitHook)
shell.RunCommand("chmod +x .git/hooks/pre-commit")
shell.CreateFileAndAdd("one", "one")
// the presence of this file will cause the pre-commit hook to fail
shell.CreateFile("bad", "bad")
},
Run: func(t *TestDriver, keys config.KeybindingConfig) {
t.Views().Files().
IsFocused().
Lines(
Contains("bad"),
Contains("one"),
).
Press(keys.Files.CommitChanges).
Tap(func() {
t.ExpectPopup().CommitMessagePanel().Type("my message").Confirm()
t.ExpectPopup().Alert().Title(Equals("Error")).Content(Contains("Git command failed")).Confirm()
}).
Press(keys.Universal.Remove). // remove file that triggers pre-commit hook to fail
Tap(func() {
t.ExpectPopup().Menu().Title(Equals("bad")).Select(Contains("discard all changes")).Confirm()
}).
Lines(
Contains("one"),
).
Press(keys.Files.CommitChanges).
Tap(func() {
t.ExpectPopup().CommitMessagePanel().
InitialText(Equals("my message")). // it remembered the commit message
Confirm()
t.Views().Commits().
Lines(
Contains("my message"),
)
})
},
})

View File

@ -0,0 +1,80 @@
package staging
import (
"github.com/jesseduffield/lazygit/pkg/config"
. "github.com/jesseduffield/lazygit/pkg/integration/components"
)
var DiffContextChange = NewIntegrationTest(NewIntegrationTestArgs{
Description: "Change the number of diff context lines while in the staging panel",
ExtraCmdArgs: "",
Skip: false,
SetupConfig: func(config *config.AppConfig) {},
SetupRepo: func(shell *Shell) {
// need to be working with a few lines so that git perceives it as two separate hunks
shell.CreateFileAndAdd("file1", "1a\n2a\n3a\n4a\n5a\n6a\n7a\n8a\n9a\n10a\n11a\n12a\n13a\n14a\n15a")
shell.Commit("one")
shell.UpdateFile("file1", "1a\n2a\n3b\n4a\n5a\n6a\n7a\n8a\n9a\n10a\n11a\n12a\n13b\n14a\n15a")
// hunk looks like:
// diff --git a/file1 b/file1
// index 3653080..a6388b6 100644
// --- a/file1
// +++ b/file1
// @@ -1,6 +1,6 @@
// 1a
// 2a
// -3a
// +3b
// 4a
// 5a
// 6a
// @@ -10,6 +10,6 @@
// 10a
// 11a
// 12a
// -13a
// +13b
// 14a
// 15a
// \ No newline at end of file
},
Run: func(t *TestDriver, keys config.KeybindingConfig) {
t.Views().Files().
IsFocused().
Lines(
Contains("file1").IsSelected(),
).
PressEnter()
t.Views().Staging().
IsFocused().
Content(Contains("@@ -1,6 +1,6 @@").DoesNotContain(" 7a")).
SelectedLine(Contains("-3a")).
Press(keys.Universal.IncreaseContextInDiffView).
// still on the same line
SelectedLine(Contains("-3a")).
// '7a' is now visible
Content(Contains("@@ -1,7 +1,7 @@").Contains(" 7a")).
Press(keys.Universal.DecreaseContextInDiffView).
SelectedLine(Contains("-3a")).
Content(Contains("@@ -1,6 +1,6 @@").DoesNotContain(" 7a")).
Press(keys.Universal.DecreaseContextInDiffView).
SelectedLine(Contains("-3a")).
Content(Contains("@@ -1,5 +1,5 @@").DoesNotContain(" 6a")).
Press(keys.Universal.DecreaseContextInDiffView).
// arguably we should still be on -3a, but at the moment the logic puts us on on +3b
SelectedLine(Contains("+3b")).
Content(Contains("@@ -2,3 +2,3 @@").DoesNotContain(" 5a")).
PressPrimaryAction().
Content(DoesNotContain("+3b")).
Press(keys.Universal.TogglePanel)
t.Views().StagingSecondary().
IsFocused().
Content(Contains("@@ -3,2 +3,3 @@\n 3a\n+3b\n 4a")).
Press(keys.Universal.IncreaseContextInDiffView).
Content(Contains("@@ -2,4 +2,5 @@\n 2a\n 3a\n+3b\n 4a\n 5a"))
},
})

View File

@ -0,0 +1,54 @@
package staging
import (
"github.com/jesseduffield/lazygit/pkg/config"
. "github.com/jesseduffield/lazygit/pkg/integration/components"
)
var DiscardAllChanges = NewIntegrationTest(NewIntegrationTestArgs{
Description: "Discard all changes of a file in the staging panel, then assert we land in the staging panel of the next file",
ExtraCmdArgs: "",
Skip: false,
SetupConfig: func(config *config.AppConfig) {},
SetupRepo: func(shell *Shell) {
shell.CreateFileAndAdd("file1", "one\ntwo\n")
shell.CreateFileAndAdd("file2", "1\n2\n")
shell.Commit("one")
shell.UpdateFile("file1", "one\ntwo\nthree\nfour\n")
shell.UpdateFile("file2", "1\n2\n3\n4\n")
},
Run: func(t *TestDriver, keys config.KeybindingConfig) {
t.Views().Files().
IsFocused().
Lines(
Contains("file1").IsSelected(),
Contains("file2"),
).
PressEnter()
t.Views().Staging().
IsFocused().
SelectedLine(Contains("+three")).
// discard the line
Press(keys.Universal.Remove).
Tap(func() {
t.Actions().ConfirmDiscardLines()
}).
SelectedLine(Contains("+four")).
// discard the other line
Press(keys.Universal.Remove).
Tap(func() {
t.Actions().ConfirmDiscardLines()
// because there are no more changes in file1 we switch to file2
t.Views().Files().
Lines(
Contains("file2").IsSelected(),
)
}).
// assert we are still in the staging panel, but now looking at the changes of the other file
IsFocused().
SelectedLine(Contains("+3"))
},
})

View File

@ -0,0 +1,91 @@
package staging
import (
"github.com/jesseduffield/lazygit/pkg/config"
. "github.com/jesseduffield/lazygit/pkg/integration/components"
)
var StageHunks = NewIntegrationTest(NewIntegrationTestArgs{
Description: "Stage and unstage various hunks of a file in the staging panel",
ExtraCmdArgs: "",
Skip: false,
SetupConfig: func(config *config.AppConfig) {},
SetupRepo: func(shell *Shell) {
// need to be working with a few lines so that git perceives it as two separate hunks
shell.CreateFileAndAdd("file1", "1a\n2a\n3a\n4a\n5a\n6a\n7a\n8a\n9a\n10a\n11a\n12a\n13a\n14a\n15a")
shell.Commit("one")
shell.UpdateFile("file1", "1a\n2a\n3b\n4a\n5a\n6a\n7a\n8a\n9a\n10a\n11a\n12a\n13b\n14a\n15a")
// hunk looks like:
// diff --git a/file1 b/file1
// index 3653080..a6388b6 100644
// --- a/file1
// +++ b/file1
// @@ -1,6 +1,6 @@
// 1a
// 2a
// -3a
// +3b
// 4a
// 5a
// 6a
// @@ -10,6 +10,6 @@
// 10a
// 11a
// 12a
// -13a
// +13b
// 14a
// 15a
// \ No newline at end of file
},
Run: func(t *TestDriver, keys config.KeybindingConfig) {
t.Views().Files().
IsFocused().
Lines(
Contains("file1").IsSelected(),
).
PressEnter()
t.Views().Staging().
IsFocused().
SelectedLine(Contains("-3a")).
Press(keys.Universal.NextBlock).
SelectedLine(Contains("-13a")).
Press(keys.Main.ToggleSelectHunk).
// when in hunk mode, pressing up/down moves us up/down by a hunk
SelectPreviousItem().
SelectedLine(Contains("-3a")).
SelectNextItem().
SelectedLine(Contains("-13a")).
// stage the second hunk
PressPrimaryAction().
Content(Contains("-3a\n+3b")).
Tap(func() {
t.Views().StagingSecondary().
Content(Contains("-13a\n+13b"))
}).
Press(keys.Universal.TogglePanel)
t.Views().StagingSecondary().
IsFocused().
SelectedLine(Contains("-13a")).
// after toggling panel, we're back to only having selected a single line
PressPrimaryAction().
SelectedLine(Contains("+13b")).
PressPrimaryAction().
IsEmpty()
t.Views().Staging().
IsFocused().
SelectedLine(Contains("-3a")).
Press(keys.Main.ToggleSelectHunk).
Press(keys.Universal.Remove).
Tap(func() {
t.Actions().ConfirmDiscardLines()
}).
SelectedLine(Contains("-13a")).
Content(DoesNotContain("-3a").DoesNotContain("+3b"))
},
})

View File

@ -0,0 +1,108 @@
package staging
import (
"github.com/jesseduffield/lazygit/pkg/config"
. "github.com/jesseduffield/lazygit/pkg/integration/components"
)
var StageLines = NewIntegrationTest(NewIntegrationTestArgs{
Description: "Stage and unstage various lines of a file in the staging panel",
ExtraCmdArgs: "",
Skip: false,
SetupConfig: func(config *config.AppConfig) {},
SetupRepo: func(shell *Shell) {
shell.CreateFileAndAdd("file1", "one\ntwo\n")
shell.Commit("one")
shell.UpdateFile("file1", "one\ntwo\nthree\nfour\n")
},
Run: func(t *TestDriver, keys config.KeybindingConfig) {
t.Views().Files().
IsFocused().
Lines(
Contains("file1").IsSelected(),
).
PressEnter()
t.Views().Staging().
IsFocused().
SelectedLine(Contains("+three")).
// stage 'three'
PressPrimaryAction().
// 'three' moves over to the staging secondary panel
Content(DoesNotContain("+three")).
Tap(func() {
t.Views().StagingSecondary().
Content(Contains("+three"))
}).
SelectedLine(Contains("+four")).
// stage 'four'
PressPrimaryAction().
// nothing left in our staging panel
IsEmpty()
// because we've staged everything we get moved to the staging secondary panel
// do the same thing as above, moving the lines back to the staging panel
t.Views().StagingSecondary().
IsFocused().
Content(Contains("+three\n+four")).
SelectedLine(Contains("+three")).
PressPrimaryAction().
Content(DoesNotContain("+three")).
Tap(func() {
t.Views().Staging().
Content(Contains("+three"))
}).
SelectedLine(Contains("+four")).
// pressing 'remove' has the same effect as pressing space when in the staging secondary panel
Press(keys.Universal.Remove).
IsEmpty()
// stage one line and then manually toggle to the staging secondary panel
t.Views().Staging().
IsFocused().
Content(Contains("+three\n+four")).
SelectedLine(Contains("+three")).
PressPrimaryAction().
Content(DoesNotContain("+three")).
Tap(func() {
t.Views().StagingSecondary().
Content(Contains("+three"))
}).
Press(keys.Universal.TogglePanel)
// manually toggle back to the staging panel
t.Views().StagingSecondary().
IsFocused().
Press(keys.Universal.TogglePanel)
t.Views().Staging().
SelectedLine(Contains("+four")).
// discard the line
Press(keys.Universal.Remove).
Tap(func() {
t.ExpectPopup().Confirmation().
Title(Equals("Unstage lines")).
Content(Contains("Are you sure you want to delete the selected lines")).
Confirm()
}).
IsEmpty()
t.Views().StagingSecondary().
IsFocused().
Content(Contains("+three\n")).
// return to file
PressEscape()
t.Views().Files().
IsFocused().
Lines(
Contains("M file1").IsSelected(),
).
PressEnter()
// because we only have a staged change we'll land in the staging secondary panel
t.Views().StagingSecondary().
IsFocused()
},
})

View File

@ -0,0 +1,75 @@
package staging
import (
"github.com/jesseduffield/lazygit/pkg/config"
. "github.com/jesseduffield/lazygit/pkg/integration/components"
)
var StageRanges = NewIntegrationTest(NewIntegrationTestArgs{
Description: "Stage and unstage various ranges of a file in the staging panel",
ExtraCmdArgs: "",
Skip: false,
SetupConfig: func(config *config.AppConfig) {},
SetupRepo: func(shell *Shell) {
shell.CreateFileAndAdd("file1", "one\ntwo\n")
shell.Commit("one")
shell.UpdateFile("file1", "one\ntwo\nthree\nfour\nfive\nsix\n")
},
Run: func(t *TestDriver, keys config.KeybindingConfig) {
t.Views().Files().
IsFocused().
Lines(
Contains("file1").IsSelected(),
).
PressEnter()
t.Views().Staging().
IsFocused().
SelectedLine(Contains("+three")).
Press(keys.Main.ToggleDragSelect).
SelectNextItem().
SelectedLine(Contains("+four")).
SelectNextItem().
SelectedLine(Contains("+five")).
// stage the three lines we've just selected
PressPrimaryAction().
Content(Contains(" five\n+six")).
Tap(func() {
t.Views().StagingSecondary().
Content(Contains("+three\n+four\n+five"))
}).
Press(keys.Universal.TogglePanel)
t.Views().StagingSecondary().
IsFocused().
SelectedLine(Contains("+three")).
Press(keys.Main.ToggleDragSelect).
SelectNextItem().
SelectedLine(Contains("+four")).
SelectNextItem().
SelectedLine(Contains("+five")).
// unstage the three selected lines
PressPrimaryAction().
// nothing left in our staging secondary panel
IsEmpty().
Tap(func() {
t.Views().Staging().
Content(Contains("+three\n+four\n+five\n+six"))
})
t.Views().Staging().
IsFocused().
// coincidentally we land at '+four' here. Maybe we should instead land
// at '+three'? given it's at the start of the hunk?
SelectedLine(Contains("+four")).
Press(keys.Main.ToggleDragSelect).
SelectNextItem().
SelectedLine(Contains("+five")).
Press(keys.Universal.Remove).
Tap(func() {
t.Actions().ConfirmDiscardLines()
}).
Content(Contains("+three\n+six"))
},
})

View File

@ -73,6 +73,7 @@ var tests = []*components.IntegrationTest{
file.DiscardChanges,
file.DiscardStagedChanges,
file.Gitignore,
file.RememberCommitMessageAfterFail,
filter_by_path.CliArg,
filter_by_path.SelectFile,
filter_by_path.TypeFile,
@ -98,7 +99,12 @@ var tests = []*components.IntegrationTest{
reflog.CherryPick,
reflog.Patch,
reflog.Reset,
staging.DiffContextChange,
staging.DiscardAllChanges,
staging.Search,
staging.StageHunks,
staging.StageLines,
staging.StageRanges,
stash.Apply,
stash.ApplyPatch,
stash.CreateBranch,
@ -139,6 +145,7 @@ var tests = []*components.IntegrationTest{
tag.CrudAnnotated,
tag.CrudLightweight,
tag.Reset,
ui.DoublePopup,
ui.SwitchTabFromMenu,
undo.UndoCheckoutAndDrop,
undo.UndoDrop,

View File

@ -0,0 +1,34 @@
package ui
import (
"github.com/jesseduffield/lazygit/pkg/config"
. "github.com/jesseduffield/lazygit/pkg/integration/components"
)
var DoublePopup = NewIntegrationTest(NewIntegrationTestArgs{
Description: "Open a popup from within another popup and assert you can escape back to the side panels",
ExtraCmdArgs: "",
Skip: false,
SetupConfig: func(config *config.AppConfig) {},
SetupRepo: func(shell *Shell) {
shell.EmptyCommit("one")
},
Run: func(t *TestDriver, keys config.KeybindingConfig) {
t.Views().Branches().
Focus().
// arbitrarily bringing up a popup
PressPrimaryAction()
t.ExpectPopup().Alert().
Title(Contains("Error")).
Content(Contains("You have already checked out this branch"))
t.GlobalPress(keys.Universal.OpenRecentRepos)
t.ExpectPopup().Menu().Title(Contains("recent repositories")).Cancel()
t.Views().Branches().IsFocused()
t.Views().Files().Focus()
},
})

View File

@ -1 +0,0 @@
ref: refs/heads/master

View File

@ -1,10 +0,0 @@
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true
[user]
email = CI@example.com
name = CI

View File

@ -1 +0,0 @@
Unnamed repository; edit this file 'description' to name the repository.

View File

@ -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

View File

@ -1,3 +0,0 @@
0000000000000000000000000000000000000000 353cce986c61f361452f43522426c120b4ee9461 CI <CI@example.com> 1659355870 +1000 commit (initial): myfile1
353cce986c61f361452f43522426c120b4ee9461 6ecdae79ff53548670039abee9008b6bb36cdf4f CI <CI@example.com> 1659355870 +1000 commit: myfile2
6ecdae79ff53548670039abee9008b6bb36cdf4f 0478d727ea0ebf57ed9ca85acef9e60a324d86f0 CI <CI@example.com> 1659355876 +1000 commit: WIP

View File

@ -1,3 +0,0 @@
0000000000000000000000000000000000000000 353cce986c61f361452f43522426c120b4ee9461 CI <CI@example.com> 1659355870 +1000 commit (initial): myfile1
353cce986c61f361452f43522426c120b4ee9461 6ecdae79ff53548670039abee9008b6bb36cdf4f CI <CI@example.com> 1659355870 +1000 commit: myfile2
6ecdae79ff53548670039abee9008b6bb36cdf4f 0478d727ea0ebf57ed9ca85acef9e60a324d86f0 CI <CI@example.com> 1659355876 +1000 commit: WIP

View File

@ -1,3 +0,0 @@
x��Λ
Β0E]η+f/Θ¤ΣΌ@Dθ�;w®“ι
Ζ–ΑΟ7�ΰκΒαpΈΌΦϊl`Ϊ.C±�8z»θH¤y$ΥΌX�� Ω�]_³ε]ή Όπ’%$UGn�> RΚE$!ΖβK!Ο=¥&Ϊcέa�α<ΝWωζΊ½δΔk½€υ.‘s1x8ZD4�φSMώΤΝ}Ύ™‚—9³

View File

@ -1,3 +0,0 @@
x�ÍA
ƒ0@Ñ®sŠÙÊŒN&Š\yŒ˜L¨`ˆH
ööõÝ~üXKYË­ª€*1c�Å ê³’—ä© ”/Ü'á¢íLø´w=`šá9Í/=CÙ7}ÄZF ±Co­wwBDsÕkÒôOnÊ7¯›’ù4],Ù

View File

@ -1,2 +0,0 @@
x�ÎM
Â0@a×9Eö‚d~2퀈ÐU�‘¦,[J½½=‚ÛÇ·xy­ui”Om7ó©#†µ„y6+*j¢e’EfÄ)d·¥Ý^ÍS¤œM{É…8baŠˆŒ’ÃÄfÊ.½ÛcÝý0úë0Þí“êö´K^ë̓D¥û.ø3„ÜQ�©frW¿eyº\+9>

View File

@ -1 +0,0 @@
0478d727ea0ebf57ed9ca85acef9e60a324d86f0

View File

@ -1 +0,0 @@
test1

View File

@ -1 +0,0 @@
test2

View File

@ -1 +0,0 @@
test3

View File

@ -1 +0,0 @@
{"KeyEvents":[{"Timestamp":607,"Mod":0,"Key":259,"Ch":0},{"Timestamp":745,"Mod":0,"Key":259,"Ch":0},{"Timestamp":1304,"Mod":0,"Key":256,"Ch":82},{"Timestamp":2087,"Mod":2,"Key":18,"Ch":18},{"Timestamp":2894,"Mod":0,"Key":27,"Ch":0},{"Timestamp":3553,"Mod":0,"Key":260,"Ch":0},{"Timestamp":3697,"Mod":0,"Key":260,"Ch":0},{"Timestamp":4064,"Mod":0,"Key":256,"Ch":32},{"Timestamp":4376,"Mod":0,"Key":256,"Ch":119},{"Timestamp":4745,"Mod":0,"Key":13,"Ch":13},{"Timestamp":5200,"Mod":0,"Key":256,"Ch":113}],"ResizeEvents":[{"Timestamp":0,"Width":238,"Height":61}]}

View File

@ -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 test1 > myfile1
git add .
git commit -am "myfile1"
echo test2 > myfile2
git add .
git commit -am "myfile2"
echo test3 > myfile3

View File

@ -1 +0,0 @@
{ "description": "stage a file and commit the change", "speed": 15 }

View File

@ -1 +0,0 @@
ref: refs/heads/master

View File

@ -1,8 +0,0 @@
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[user]
email = CI@example.com
name = CI

View File

@ -1 +0,0 @@
Unnamed repository; edit this file 'description' to name the repository.

View File

@ -1,6 +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]
# *~

View File

@ -1,2 +0,0 @@
0000000000000000000000000000000000000000 c2bf9b666a310383fd7095bc5bd993bba11b040e CI <CI@example.com> 1640438057 +0100 commit (initial): first commit
c2bf9b666a310383fd7095bc5bd993bba11b040e d0ce4cb10cd926f646a08889b077a6d7eddd3534 CI <CI@example.com> 1640438062 +0100 commit: second commit

View File

@ -1,2 +0,0 @@
0000000000000000000000000000000000000000 c2bf9b666a310383fd7095bc5bd993bba11b040e CI <CI@example.com> 1640438057 +0100 commit (initial): first commit
c2bf9b666a310383fd7095bc5bd993bba11b040e d0ce4cb10cd926f646a08889b077a6d7eddd3534 CI <CI@example.com> 1640438062 +0100 commit: second commit

View File

@ -1 +0,0 @@
d0ce4cb10cd926f646a08889b077a6d7eddd3534

View File

@ -1 +0,0 @@
{"KeyEvents":[{"Timestamp":1360,"Mod":0,"Key":256,"Ch":106},{"Timestamp":2124,"Mod":0,"Key":256,"Ch":32},{"Timestamp":4000,"Mod":0,"Key":256,"Ch":99},{"Timestamp":4595,"Mod":0,"Key":256,"Ch":102},{"Timestamp":4730,"Mod":0,"Key":256,"Ch":105},{"Timestamp":4831,"Mod":0,"Key":256,"Ch":114},{"Timestamp":5011,"Mod":0,"Key":256,"Ch":115},{"Timestamp":5122,"Mod":0,"Key":256,"Ch":116},{"Timestamp":5552,"Mod":0,"Key":256,"Ch":32},{"Timestamp":5778,"Mod":0,"Key":256,"Ch":99},{"Timestamp":5882,"Mod":0,"Key":256,"Ch":111},{"Timestamp":6046,"Mod":0,"Key":256,"Ch":109},{"Timestamp":6212,"Mod":0,"Key":256,"Ch":109},{"Timestamp":6449,"Mod":0,"Key":256,"Ch":105},{"Timestamp":6550,"Mod":0,"Key":256,"Ch":116},{"Timestamp":7347,"Mod":0,"Key":13,"Ch":13},{"Timestamp":9314,"Mod":0,"Key":13,"Ch":13},{"Timestamp":10322,"Mod":0,"Key":256,"Ch":107},{"Timestamp":11012,"Mod":0,"Key":256,"Ch":100},{"Timestamp":11547,"Mod":0,"Key":13,"Ch":13},{"Timestamp":12960,"Mod":0,"Key":256,"Ch":99},{"Timestamp":13863,"Mod":0,"Key":13,"Ch":13},{"Timestamp":15574,"Mod":0,"Key":256,"Ch":32},{"Timestamp":16365,"Mod":0,"Key":256,"Ch":99},{"Timestamp":16977,"Mod":0,"Key":256,"Ch":115},{"Timestamp":17111,"Mod":0,"Key":256,"Ch":101},{"Timestamp":17308,"Mod":0,"Key":256,"Ch":99},{"Timestamp":17420,"Mod":0,"Key":256,"Ch":111},{"Timestamp":17442,"Mod":0,"Key":256,"Ch":110},{"Timestamp":17593,"Mod":0,"Key":256,"Ch":100},{"Timestamp":17814,"Mod":0,"Key":256,"Ch":32},{"Timestamp":18040,"Mod":0,"Key":256,"Ch":99},{"Timestamp":18127,"Mod":0,"Key":256,"Ch":111},{"Timestamp":18269,"Mod":0,"Key":256,"Ch":109},{"Timestamp":18409,"Mod":0,"Key":256,"Ch":109},{"Timestamp":18694,"Mod":0,"Key":256,"Ch":105},{"Timestamp":18803,"Mod":0,"Key":256,"Ch":116},{"Timestamp":19624,"Mod":0,"Key":13,"Ch":13},{"Timestamp":21204,"Mod":0,"Key":256,"Ch":113}],"ResizeEvents":[{"Timestamp":0,"Width":212,"Height":55}]}

View File

@ -1,23 +0,0 @@
#!/bin/sh
set -e
cd $1
git init
git config user.email "CI@example.com"
git config user.name "CI"
git checkout -b master
echo "file1" > file1
echo "file2" > file2
echo "disruptive" > disruptive
cat > .git/hooks/pre-commit <<EOL
#!/bin/bash
if [ -f disruptive ]; then
exit 1
fi
exit 0
EOL
chmod +x .git/hooks/pre-commit

View File

@ -1 +0,0 @@
{"description": "In this test we attempt to create a commit with the commit message `first commit`, but a pre-commit hook fails (the hook checks for the existance of a file called `disruptive`). Afterwards we make the pre-commit hook work (by discarding the file), and again attempt to create a commit. This time the commit message should already be remembered from the failed attempt and be prefilled. Then another commit is made with the message `second commit`, and this time the last commit message no longer prefilled.", "speed": 20}

View File

@ -1 +0,0 @@
ref: refs/heads/master

View File

@ -1,10 +0,0 @@
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true
[user]
email = CI@example.com
name = CI

View File

@ -1 +0,0 @@
Unnamed repository; edit this file 'description' to name the repository.

View File

@ -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

View File

@ -1 +0,0 @@
0000000000000000000000000000000000000000 1854ab416d299cda0227d62b9ab0765e5551ef57 CI <CI@example.com> 1642499804 +1100 commit (initial): file1

View File

@ -1 +0,0 @@
0000000000000000000000000000000000000000 1854ab416d299cda0227d62b9ab0765e5551ef57 CI <CI@example.com> 1642499804 +1100 commit (initial): file1

View File

@ -1 +0,0 @@
1854ab416d299cda0227d62b9ab0765e5551ef57

View File

@ -1,67 +0,0 @@
package oscommands
import (
"github.com/jesseduffield/lazygit/pkg/common"
"github.com/jesseduffield/lazygit/pkg/utils"
)
// NewDummyOSCommand creates a new dummy OSCommand for testing
func NewDummyOSCommand() *OSCommand {
osCmd := NewOSCommand(utils.NewDummyCommon(), dummyPlatform, NewNullGuiIO(utils.NewDummyLog()))
return osCmd
}
type OSCommandDeps struct {
Common *common.Common
Platform *Platform
GetenvFn func(string) string
RemoveFileFn func(string) error
Cmd *CmdObjBuilder
}
func NewDummyOSCommandWithDeps(deps OSCommandDeps) *OSCommand {
if deps.Cmd == nil {
panic("WHAT")
}
common := deps.Common
if common == nil {
common = utils.NewDummyCommon()
}
platform := deps.Platform
if platform == nil {
platform = dummyPlatform
}
return &OSCommand{
Common: common,
Platform: platform,
getenvFn: deps.GetenvFn,
removeFileFn: deps.RemoveFileFn,
guiIO: NewNullGuiIO(utils.NewDummyLog()),
Cmd: deps.Cmd,
}
}
func NewDummyCmdObjBuilder(runner ICmdObjRunner) *CmdObjBuilder {
return &CmdObjBuilder{
runner: runner,
platform: dummyPlatform,
}
}
var dummyPlatform = &Platform{
OS: "darwin",
Shell: "bash",
ShellArg: "-c",
OpenCommand: "open {{filename}}",
OpenLinkCommand: "open {{link}}",
}
func NewDummyOSCommandWithRunner(runner *FakeCmdObjRunner) *OSCommand {
osCommand := NewOSCommand(utils.NewDummyCommon(), dummyPlatform, NewNullGuiIO(utils.NewDummyLog()))
osCommand.Cmd = NewDummyCmdObjBuilder(runner)
return osCommand
}

View File

@ -1,63 +0,0 @@
package oscommands
import (
"github.com/jesseduffield/lazygit/pkg/common"
"github.com/jesseduffield/lazygit/pkg/utils"
)
// NewDummyOSCommand creates a new dummy OSCommand for testing
func NewDummyOSCommand() *OSCommand {
osCmd := NewOSCommand(utils.NewDummyCommon(), dummyPlatform, NewNullGuiIO(utils.NewDummyLog()))
return osCmd
}
type OSCommandDeps struct {
Common *common.Common
Platform *Platform
GetenvFn func(string) string
RemoveFileFn func(string) error
Cmd *CmdObjBuilder
}
func NewDummyOSCommandWithDeps(deps OSCommandDeps) *OSCommand {
common := deps.Common
if common == nil {
common = utils.NewDummyCommon()
}
platform := deps.Platform
if platform == nil {
platform = dummyPlatform
}
return &OSCommand{
Common: common,
Platform: platform,
getenvFn: deps.GetenvFn,
removeFileFn: deps.RemoveFileFn,
guiIO: NewNullGuiIO(utils.NewDummyLog()),
}
}
func NewDummyCmdObjBuilder(runner ICmdObjRunner) *CmdObjBuilder {
return &CmdObjBuilder{
runner: runner,
platform: dummyPlatform,
}
}
var dummyPlatform = &Platform{
OS: "darwin",
Shell: "bash",
ShellArg: "-c",
OpenCommand: "open {{filename}}",
OpenLinkCommand: "open {{link}}",
}
func NewDummyOSCommandWithRunner(runner *FakeCmdObjRunner) *OSCommand {
osCommand := NewOSCommand(utils.NewDummyCommon(), dummyPlatform, NewNullGuiIO(utils.NewDummyLog()))
osCommand.Cmd = NewDummyCmdObjBuilder(runner)
return osCommand
}

View File

@ -1,67 +0,0 @@
package oscommands
import (
"github.com/jesseduffield/lazygit/pkg/common"
"github.com/jesseduffield/lazygit/pkg/utils"
)
// NewDummyOSCommand creates a new dummy OSCommand for testing
func NewDummyOSCommand() *OSCommand {
osCmd := NewOSCommand(utils.NewDummyCommon(), dummyPlatform, NewNullGuiIO(utils.NewDummyLog()))
return osCmd
}
type OSCommandDeps struct {
Common *common.Common
Platform *Platform
GetenvFn func(string) string
RemoveFileFn func(string) error
Cmd *CmdObjBuilder
}
func NewDummyOSCommandWithDeps(deps OSCommandDeps) *OSCommand {
if deps.Cmd == nil {
panic("WHAT")
}
common := deps.Common
if common == nil {
common = utils.NewDummyCommon()
}
platform := deps.Platform
if platform == nil {
platform = dummyPlatform
}
return &OSCommand{
Common: common,
Platform: platform,
getenvFn: deps.GetenvFn,
removeFileFn: deps.RemoveFileFn,
guiIO: NewNullGuiIO(utils.NewDummyLog()),
Cmd: deps.Cmd,
}
}
func NewDummyCmdObjBuilder(runner ICmdObjRunner) *CmdObjBuilder {
return &CmdObjBuilder{
runner: runner,
platform: dummyPlatform,
}
}
var dummyPlatform = &Platform{
OS: "darwin",
Shell: "bash",
ShellArg: "-c",
OpenCommand: "open {{filename}}",
OpenLinkCommand: "open {{link}}",
}
func NewDummyOSCommandWithRunner(runner *FakeCmdObjRunner) *OSCommand {
osCommand := NewOSCommand(utils.NewDummyCommon(), dummyPlatform, NewNullGuiIO(utils.NewDummyLog()))
osCommand.Cmd = NewDummyCmdObjBuilder(runner)
return osCommand
}

View File

@ -1 +0,0 @@
{"KeyEvents":[{"Timestamp":1395,"Mod":0,"Key":13,"Ch":13},{"Timestamp":3036,"Mod":0,"Key":256,"Ch":125},{"Timestamp":3283,"Mod":0,"Key":256,"Ch":125},{"Timestamp":3483,"Mod":0,"Key":256,"Ch":125},{"Timestamp":3996,"Mod":0,"Key":256,"Ch":32},{"Timestamp":4629,"Mod":0,"Key":258,"Ch":0},{"Timestamp":5004,"Mod":0,"Key":258,"Ch":0},{"Timestamp":5067,"Mod":0,"Key":256,"Ch":118},{"Timestamp":5547,"Mod":0,"Key":257,"Ch":0},{"Timestamp":5867,"Mod":0,"Key":256,"Ch":118},{"Timestamp":6492,"Mod":0,"Key":256,"Ch":118},{"Timestamp":6628,"Mod":0,"Key":257,"Ch":0},{"Timestamp":6762,"Mod":0,"Key":257,"Ch":0},{"Timestamp":7779,"Mod":0,"Key":256,"Ch":125},{"Timestamp":8179,"Mod":0,"Key":256,"Ch":125},{"Timestamp":8723,"Mod":0,"Key":256,"Ch":32},{"Timestamp":9531,"Mod":0,"Key":259,"Ch":0},{"Timestamp":10170,"Mod":0,"Key":258,"Ch":0},{"Timestamp":10379,"Mod":0,"Key":258,"Ch":0},{"Timestamp":10500,"Mod":0,"Key":258,"Ch":0},{"Timestamp":10833,"Mod":0,"Key":258,"Ch":0},{"Timestamp":10849,"Mod":0,"Key":258,"Ch":0},{"Timestamp":10865,"Mod":0,"Key":258,"Ch":0},{"Timestamp":10881,"Mod":0,"Key":258,"Ch":0},{"Timestamp":10898,"Mod":0,"Key":258,"Ch":0},{"Timestamp":10915,"Mod":0,"Key":258,"Ch":0},{"Timestamp":10931,"Mod":0,"Key":258,"Ch":0},{"Timestamp":10947,"Mod":0,"Key":258,"Ch":0},{"Timestamp":10964,"Mod":0,"Key":258,"Ch":0},{"Timestamp":11156,"Mod":0,"Key":258,"Ch":0},{"Timestamp":11308,"Mod":0,"Key":258,"Ch":0},{"Timestamp":11435,"Mod":0,"Key":256,"Ch":118},{"Timestamp":11571,"Mod":0,"Key":258,"Ch":0},{"Timestamp":11700,"Mod":0,"Key":258,"Ch":0},{"Timestamp":11828,"Mod":0,"Key":258,"Ch":0},{"Timestamp":11963,"Mod":0,"Key":258,"Ch":0},{"Timestamp":12083,"Mod":0,"Key":258,"Ch":0},{"Timestamp":12603,"Mod":0,"Key":256,"Ch":32},{"Timestamp":13051,"Mod":0,"Key":9,"Ch":9},{"Timestamp":14820,"Mod":0,"Key":256,"Ch":118},{"Timestamp":15028,"Mod":0,"Key":258,"Ch":0},{"Timestamp":15139,"Mod":0,"Key":258,"Ch":0},{"Timestamp":15266,"Mod":0,"Key":258,"Ch":0},{"Timestamp":15387,"Mod":0,"Key":258,"Ch":0},{"Timestamp":15500,"Mod":0,"Key":258,"Ch":0},{"Timestamp":16266,"Mod":0,"Key":256,"Ch":125},{"Timestamp":16483,"Mod":0,"Key":256,"Ch":125},{"Timestamp":16747,"Mod":0,"Key":256,"Ch":125},{"Timestamp":17412,"Mod":0,"Key":256,"Ch":32},{"Timestamp":19124,"Mod":0,"Key":256,"Ch":113}],"ResizeEvents":[{"Timestamp":0,"Width":272,"Height":74}]}

View File

@ -1,16 +0,0 @@
#!/bin/sh
set -e
cd $1
git init
git config user.email "CI@example.com"
git config user.name "CI"
cp ../../files/one.txt one.txt
git add .
git commit -am file1
cp ../../files/one_new.txt one.txt

View File

@ -1,4 +0,0 @@
{
"description": "Staging a file and also changing the diff context",
"speed": 20
}

View File

@ -1 +0,0 @@
ref: refs/heads/master

View File

@ -1,10 +0,0 @@
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true
[user]
email = CI@example.com
name = CI

View File

@ -1 +0,0 @@
Unnamed repository; edit this file 'description' to name the repository.

View File

@ -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

View File

@ -1,2 +0,0 @@
0000000000000000000000000000000000000000 6497d00f0447159947a805f3a38e8c44ed2865b1 CI <CI@example.com> 1659701362 +1000 commit (initial): file1
6497d00f0447159947a805f3a38e8c44ed2865b1 a6985076907d3ed64cf59480bb2eec313ea221cf CI <CI@example.com> 1659701393 +1000 commit: test

View File

@ -1,2 +0,0 @@
0000000000000000000000000000000000000000 6497d00f0447159947a805f3a38e8c44ed2865b1 CI <CI@example.com> 1659701362 +1000 commit (initial): file1
6497d00f0447159947a805f3a38e8c44ed2865b1 a6985076907d3ed64cf59480bb2eec313ea221cf CI <CI@example.com> 1659701393 +1000 commit: test

View File

@ -1,4 +0,0 @@
xM’±nÜ0 †;û)þN·øŒtÉÐN:dêÈÐY¶hK8Yt%ê„ÛúyÂ<I()
†Eþ"?þôxÆã—‡O—"G‰FT:ÝÕ„+Yü.^kòm¸£Æ2âFœÏËX®&Zh”"ªç÷ sè‰9hºëŸM²µ®óùð!ø¸a§œÏâc†�à’àT? ý¢;e%:dĬˆ-¹èËlëm< jÒ†4 Otj%HŸ¢—Ç\B É�Â5�^ÞÙáÅ%sD
~Ç©d¥ªNp„l”Ê^e4_•VBÏû@]àÌMÏmú4˽s µ¦;¤fDº‘Ži¿ƒ×6@þÜjÓAl7«jˆÌVZ—r°
WöiøÉÈzò”tˆÃxÛöpõËf3êœàI=¸RÊÓõG¼ýyÅ5rmF‹Óv3‰(ÒÞvÅ¥uà�Æá»npKm‡IÁSþú× 2‹Ã‘¸X¬~s-;«ýYýî2püøVNþFù"Kk0¢ÅÖÐôï‡8Öï

View File

@ -1,2 +0,0 @@
x=’=ŽÛ0…Sëo+7²»Ý"©¤Øj`‹­)q$¦9
,¸Ë!rÂœ$� ¼€ @óû½7š‚Nxyyþr®ÅI’»n‚Ý„‹Xüª¾–ä%ÚpGÝP?Ä7âxÞM�Õ=ÂD F%b÷ÅÁùëˆY5ôĘîõ?M²9×ùŒ¼ù|\q•œ�ÅÇ ¡5Á±þ4|t�ý²°ƒtX“pCq~¾@m«Ô¥�šÒ'Ò™Q¹K¦Ž­Œ˜(¬Î|™U`½�‡‚=SNëeð©ljôS AJîì®°yub‡w—Ì%œð!˜�¦šI¶;B‘.j1A—2’�aŸKèy¤8sã÷cM÷`¾wŽáLC»¯t>#ÊM(#ÊõÞ$’=?µ™Át�Û-Þ³Ö¶åÓw –põzÞ™_^ElÆÓEÅ¥¹gVC¿ ^y‡MwI¹ùý˜?âïï?¸DÝÛyŠã:ZÏó&ÞŠ'ÖÚVèUÆá;ÿÈí&å¯ÿí3;lI«ÅâW×:'úŸi8¦ ��ßhÑ„ào’¿!ji F´ØZý?<éÇ

View File

@ -1,2 +0,0 @@
x=’;ŽÜ0DëåhÍdÞÀŽ 8ØhÇÀSbK$†bËüŒ0™áú$.Ò˜êï«jMA'<?ùt©ÅI’‡<݇ W±øU},ÉK´áŽº£(~ˆ)nÄé4¼™«G„‰ŒJÄዃóÛˆY5ôĘîõ?M²9×ùŒ¼û|\±IΧâc†�КàXÞ;HŽ~YØA:¬I¸¡8?_‘7 ºôQSú@º°_î’©c/#&
k#g¾Ì*°Þ"jÁ‘È)çáEž uð©ìjøS AJîð®°{ub‡7—Ì%œñ.˜�¦š‰v8R/Š1A—2žaŸKèy¤8sã÷cM7a¾wŽáBG»±´>#ÊM¨#Êvo Ÿ?·™Át�Û=>³Ö¶åÃx –pu;¯ŠÌ//‰"vCí<ßµÙgVCà ^xˆ]I¹þ˜?âïï?¸F=Ú}ŠãºIJ!ÒÖN¬µmÐMÆá;ϳðô‰à)ýÙaOZ-¿º–�è¦ß½ ¿Ñ¢ Áß$ë‡á‚-¶„Vÿvé¿

Some files were not shown because too many files have changed in this diff Show More