mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-31 14:24:25 +03:00
update test
This commit is contained in:
committed by
Luka Markušić
parent
0141bbde0e
commit
23d39c79b2
@ -76,6 +76,12 @@ func (self *Input) Confirm() {
|
||||
self.pressKey(self.keys.Universal.Confirm)
|
||||
}
|
||||
|
||||
func (self *Input) ProceedWhenAsked(matcher *matcher) {
|
||||
self.assert.InConfirm()
|
||||
self.assert.MatchCurrentViewContent(matcher)
|
||||
self.Confirm()
|
||||
}
|
||||
|
||||
// i.e. same as Confirm
|
||||
func (self *Input) Enter() {
|
||||
self.pressKey(self.keys.Universal.Confirm)
|
||||
|
@ -5,6 +5,11 @@ import (
|
||||
. "github.com/jesseduffield/lazygit/pkg/integration/components"
|
||||
)
|
||||
|
||||
var (
|
||||
postMergeFileContent = "post merge file content"
|
||||
postMergeFilename = "post-merge-file"
|
||||
)
|
||||
|
||||
var AmendMerge = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
Description: "Amends a staged file to a merge commit.",
|
||||
ExtraCmdArgs: "",
|
||||
@ -13,14 +18,14 @@ var AmendMerge = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
SetupRepo: func(shell *Shell) {
|
||||
shell.
|
||||
NewBranch("development-branch").
|
||||
CreateFileAndAdd("initial-file", "content").
|
||||
CreateFileAndAdd("initial-file", "initial file content").
|
||||
Commit("initial commit").
|
||||
NewBranch("feature-branch"). // it's also checked out automatically
|
||||
CreateFileAndAdd("new-feature-file", "new content").
|
||||
Commit("new feature commit").
|
||||
CheckoutBranch("development-branch").
|
||||
Checkout("development-branch").
|
||||
Merge("feature-branch").
|
||||
CreateFileAndAdd("post-merge-file", "content")
|
||||
CreateFileAndAdd(postMergeFilename, postMergeFileContent)
|
||||
},
|
||||
Run: func(shell *Shell, input *Input, assert *Assert, keys config.KeybindingConfig) {
|
||||
assert.CommitCount(3)
|
||||
@ -28,10 +33,18 @@ var AmendMerge = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
input.SwitchToCommitsWindow()
|
||||
assert.CurrentViewName("commits")
|
||||
|
||||
input.PressKeys(keys.Commits.AmendToCommit)
|
||||
input.PressKeys(keys.Universal.Return)
|
||||
mergeCommitMessage := "Merge branch 'feature-branch' into development-branch"
|
||||
assert.MatchHeadCommitMessage(Contains(mergeCommitMessage))
|
||||
|
||||
assert.MatchHeadCommitMessage(Contains("Merge"))
|
||||
input.PressKeys(keys.Commits.AmendToCommit)
|
||||
input.ProceedWhenAsked(Contains("Are you sure you want to amend this commit with your staged files?"))
|
||||
|
||||
// assuring we haven't added a brand new commit
|
||||
assert.CommitCount(3)
|
||||
assert.MatchHeadCommitMessage(Contains(mergeCommitMessage))
|
||||
|
||||
// assuring the post-merge file shows up in the merge commit.
|
||||
assert.MatchMainViewContent(Contains(postMergeFilename))
|
||||
assert.MatchMainViewContent(Contains("++" + postMergeFileContent))
|
||||
},
|
||||
})
|
||||
|
@ -1 +1 @@
|
||||
new feature commit
|
||||
fixup! Merge branch 'feature-branch' into development-branch
|
||||
|
@ -1 +1 @@
|
||||
a69464e3729a09e3a526d4a2db209ee43e64ba1c
|
||||
7802c86c6ce62289e32aa13d0c85dc3f733195cb
|
||||
|
@ -3,6 +3,8 @@
|
||||
filemode = true
|
||||
bare = false
|
||||
logallrefupdates = true
|
||||
ignorecase = true
|
||||
precomposeunicode = true
|
||||
[user]
|
||||
email = CI@example.com
|
||||
name = CI
|
||||
|
Binary file not shown.
@ -4,3 +4,4 @@
|
||||
# exclude patterns (uncomment them if you want to use them):
|
||||
# *.[oa]
|
||||
# *~
|
||||
.DS_Store
|
||||
|
@ -1,5 +1,12 @@
|
||||
0000000000000000000000000000000000000000 a69464e3729a09e3a526d4a2db209ee43e64ba1c CI <CI@example.com> 1662823399 +0200 commit (initial): initial commit
|
||||
a69464e3729a09e3a526d4a2db209ee43e64ba1c a69464e3729a09e3a526d4a2db209ee43e64ba1c CI <CI@example.com> 1662823399 +0200 checkout: moving from development-branch to feature-branch
|
||||
a69464e3729a09e3a526d4a2db209ee43e64ba1c 5e62a9dc2e1352e7ee6ecf17033e2ed3382efc6f CI <CI@example.com> 1662823399 +0200 commit: new feature commit
|
||||
5e62a9dc2e1352e7ee6ecf17033e2ed3382efc6f a69464e3729a09e3a526d4a2db209ee43e64ba1c CI <CI@example.com> 1662823399 +0200 checkout: moving from feature-branch to development-branch
|
||||
a69464e3729a09e3a526d4a2db209ee43e64ba1c 77e1bb1effc5857c4d701219a001823432e3586d CI <CI@example.com> 1662823399 +0200 merge feature-branch: Merge made by the 'ort' strategy.
|
||||
0000000000000000000000000000000000000000 3ad14f8b4ed479f2fd9d8d4f7fe2a9913771b7f3 CI <CI@example.com> 1663440492 -0700 commit (initial): initial commit
|
||||
3ad14f8b4ed479f2fd9d8d4f7fe2a9913771b7f3 3ad14f8b4ed479f2fd9d8d4f7fe2a9913771b7f3 CI <CI@example.com> 1663440492 -0700 checkout: moving from development-branch to feature-branch
|
||||
3ad14f8b4ed479f2fd9d8d4f7fe2a9913771b7f3 d1c7801838f293fe8f4b49dae6b4919d0359e6e6 CI <CI@example.com> 1663440492 -0700 commit: new feature commit
|
||||
d1c7801838f293fe8f4b49dae6b4919d0359e6e6 3ad14f8b4ed479f2fd9d8d4f7fe2a9913771b7f3 CI <CI@example.com> 1663440492 -0700 checkout: moving from feature-branch to development-branch
|
||||
3ad14f8b4ed479f2fd9d8d4f7fe2a9913771b7f3 f68c5b48c653ca6ab23abd7606fe8fa8cc8d5b15 CI <CI@example.com> 1663440492 -0700 merge feature-branch: Merge made by the 'recursive' strategy.
|
||||
f68c5b48c653ca6ab23abd7606fe8fa8cc8d5b15 7802c86c6ce62289e32aa13d0c85dc3f733195cb CI <CI@example.com> 1663440493 -0700 commit: fixup! Merge branch 'feature-branch' into development-branch
|
||||
7802c86c6ce62289e32aa13d0c85dc3f733195cb 3ad14f8b4ed479f2fd9d8d4f7fe2a9913771b7f3 CI <CI@example.com> 1663440494 -0700 rebase (start): checkout f68c5b48c653ca6ab23abd7606fe8fa8cc8d5b15^
|
||||
3ad14f8b4ed479f2fd9d8d4f7fe2a9913771b7f3 d1c7801838f293fe8f4b49dae6b4919d0359e6e6 CI <CI@example.com> 1663440494 -0700 rebase: fast-forward
|
||||
d1c7801838f293fe8f4b49dae6b4919d0359e6e6 3ad14f8b4ed479f2fd9d8d4f7fe2a9913771b7f3 CI <CI@example.com> 1663440494 -0700 rebase (reset): 'onto'
|
||||
3ad14f8b4ed479f2fd9d8d4f7fe2a9913771b7f3 f68c5b48c653ca6ab23abd7606fe8fa8cc8d5b15 CI <CI@example.com> 1663440494 -0700 rebase: fast-forward
|
||||
f68c5b48c653ca6ab23abd7606fe8fa8cc8d5b15 f517de66e2a158d4a1d85246611cae9ca23a938d CI <CI@example.com> 1663440494 -0700 rebase (fixup): Merge branch 'feature-branch' into development-branch
|
||||
f517de66e2a158d4a1d85246611cae9ca23a938d f517de66e2a158d4a1d85246611cae9ca23a938d CI <CI@example.com> 1663440494 -0700 rebase (finish): returning to refs/heads/development-branch
|
||||
|
@ -1,2 +1,4 @@
|
||||
0000000000000000000000000000000000000000 a69464e3729a09e3a526d4a2db209ee43e64ba1c CI <CI@example.com> 1662823399 +0200 commit (initial): initial commit
|
||||
a69464e3729a09e3a526d4a2db209ee43e64ba1c 77e1bb1effc5857c4d701219a001823432e3586d CI <CI@example.com> 1662823399 +0200 merge feature-branch: Merge made by the 'ort' strategy.
|
||||
0000000000000000000000000000000000000000 3ad14f8b4ed479f2fd9d8d4f7fe2a9913771b7f3 CI <CI@example.com> 1663440492 -0700 commit (initial): initial commit
|
||||
3ad14f8b4ed479f2fd9d8d4f7fe2a9913771b7f3 f68c5b48c653ca6ab23abd7606fe8fa8cc8d5b15 CI <CI@example.com> 1663440492 -0700 merge feature-branch: Merge made by the 'recursive' strategy.
|
||||
f68c5b48c653ca6ab23abd7606fe8fa8cc8d5b15 7802c86c6ce62289e32aa13d0c85dc3f733195cb CI <CI@example.com> 1663440493 -0700 commit: fixup! Merge branch 'feature-branch' into development-branch
|
||||
7802c86c6ce62289e32aa13d0c85dc3f733195cb f517de66e2a158d4a1d85246611cae9ca23a938d CI <CI@example.com> 1663440494 -0700 rebase (finish): refs/heads/development-branch onto 3ad14f8b4ed479f2fd9d8d4f7fe2a9913771b7f3
|
||||
|
@ -1,2 +1,2 @@
|
||||
0000000000000000000000000000000000000000 a69464e3729a09e3a526d4a2db209ee43e64ba1c CI <CI@example.com> 1662823399 +0200 branch: Created from HEAD
|
||||
a69464e3729a09e3a526d4a2db209ee43e64ba1c 5e62a9dc2e1352e7ee6ecf17033e2ed3382efc6f CI <CI@example.com> 1662823399 +0200 commit: new feature commit
|
||||
0000000000000000000000000000000000000000 3ad14f8b4ed479f2fd9d8d4f7fe2a9913771b7f3 CI <CI@example.com> 1663440492 -0700 branch: Created from HEAD
|
||||
3ad14f8b4ed479f2fd9d8d4f7fe2a9913771b7f3 d1c7801838f293fe8f4b49dae6b4919d0359e6e6 CI <CI@example.com> 1663440492 -0700 commit: new feature commit
|
||||
|
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<01><>K
|
||||
<EFBFBD>@]<5D>)z/H<>g<EFBFBD>ɀ<EFBFBD><C980>U<EFBFBD>љ<EFBFBD>A<EFBFBD>|<13><><06><><EFBFBD>WT<57>K<EFBFBD>4= ק<><01>YR<59><52><04>-1l<>R46<34><01><><EFBFBD>9<><39>V<EFBFBD>02<>A|#<23>8<EFBFBD>[-:<06>q<EFBFBD>c"xh<18>J<EFBFBD><4A><EFBFBD>X6<58>z<EFBFBD>v<EFBFBD><1F><>.i<>nT<6E>J+<2B><>Hgfw<66><77>T<EFBFBD><54><EFBFBD><EFBFBD><EFBFBD><EFBFBD>+<2B><06><><EFBFBD><0B><>?>
|
Binary file not shown.
Binary file not shown.
@ -1 +0,0 @@
|
||||
x<01><><EFBFBD>j1ES<45>W<EFBFBD>s<12>3<EFBFBD>Y B0<42>r<EFBFBD><72><EFBFBD>]<5D><06>!<21>|~<16><>)Ͻ<>9<EFBFBD><39><EFBFBD><EFBFBD>9<EFBFBD><39><EFBFBD>U<EFBFBD><55>'<27>"c`V<>Px-<2D>`<60>|1<><31>|<7C><>mZ<6D>4<EFBFBD><34><EFBFBD><04>HI}<02>@<40><>R<EFBFBD>hG<04><>I{<7B><>i<>F<EFBFBD>y <20><><EFBFBD>J?zf2s$<14><><EFBFBD><EFBFBD>]<5D><>Ng<4E>v:<1F><><EFBFBD>vë<76><C3AB><EFBFBD><EFBFBD>E(sJ<73>ٓ<EFBFBD>ݾ<EFBFBD>
|
@ -0,0 +1,2 @@
|
||||
x<01><>Mj<4D>0F<><46>)<29><><EFBFBD>R$<24><>J <20>,z<><7A>x<EFBFBD>1D<31>r<><72>kh<0E><><EFBFBD>xTK<54>;.~<7E><>֍ݠ%k!<21>"<22>iF<69>y<EFBFBD><79>h<EFBFBD>f<08><><EFBFBD>j<EFBFBD><6A>K <09>|v<><76><EFBFBD><EFBFBD><01>`1O1<4F> <20>Q<>|6^<5E><>o<EFBFBD><6F><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>O,띿<><EB9DBF>o0!X<><58>-u<>Z<EFBFBD><5A><1E><>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!7\<5C>a<>[<5B><>?`^z<><7A>|<7C>k<EFBFBD><6B>_B<5F><01><>N<EFBFBD>
|
Binary file not shown.
Binary file not shown.
@ -1,2 +0,0 @@
|
||||
x<01><>K
|
||||
<EFBFBD>0@]<5D><14>$<24><><17>]<5D><18>8`<60>1<EFBFBD>D<EFBFBD><44>
|
Binary file not shown.
@ -0,0 +1,2 @@
|
||||
x<01><><EFBFBD>jAD<1D>Wt<57>Hf<48><66>9@<18>"<05><>9<EFBFBD>-<2D>fwFƟ<46>˱<><CBB1><EFBFBD>^<5E><><EFBFBD><EFBFBD>m<EFBFBD> <09>et<65>,Gx6J<36><4A>R<EFBFBD><52>g<EFBFBD><67>9<EFBFBD>Z<EFBFBD><5A>I<1B><>9`<60>R<EFBFBD>2Ȧ<32>YBfT<66>Q<EFBFBD><51>XCe<43><02>b<EFBFBD><62>{<7B><><EFBFBD>?<3F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1<>
|
||||
<EFBFBD>p<EFBFBD>X<13>:Ve<56>7<>Ǹ<EFBFBD><C7B8><EFBFBD>:<3A>/<2F><>Nm<4E>㵬퍴s<ED8DB4>Yq4tT^<5E>i_w<5F><77>p~<7E><><07>'(<28><><EFBFBD>+i<:<3A><><EFBFBD>@<40>e<EFBFBD>T<EFBFBD><54><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>yL?2#Y|
|
@ -0,0 +1,2 @@
|
||||
x<01><><EFBFBD>jC1DS߯<53>Ε<EFBFBD>kiB<08>r<EFBFBD><72><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>C>?<17><><EFBFBD><EFBFBD><EFBFBD>9<EFBFBD>i<EFBFBD><<3C><04><><EFBFBD>U!W<>4&Gµ<47><C2B5><EFBFBD>)#5v<35><76><EFBFBD>{<7B><16><><EFBFBD>V<EFBFBD>.b<>}<7D><>*<2A>ق Z6
|
||||
<EFBFBD><EFBFBD>ǜ}<7D><16>x<EFBFBD>-<2D><><14>GS2<53><32>R4<52><34>Y\<<3C>&MSy<53><79><EFBFBD><EFBFBD>|<7C><><EFBFBD><EFBFBD>M<EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>+<2B><>"<22>Cptٹi_w<5F><77><EFBFBD>ħw<C4A7>
|
@ -1 +1 @@
|
||||
77e1bb1effc5857c4d701219a001823432e3586d
|
||||
f517de66e2a158d4a1d85246611cae9ca23a938d
|
||||
|
@ -1 +1 @@
|
||||
5e62a9dc2e1352e7ee6ecf17033e2ed3382efc6f
|
||||
d1c7801838f293fe8f4b49dae6b4919d0359e6e6
|
||||
|
@ -1 +1 @@
|
||||
content
|
||||
initial file content
|
@ -1 +1 @@
|
||||
content
|
||||
post merge file content
|
Reference in New Issue
Block a user