mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-08-07 22:02:56 +03:00
migrate pull integration test
This commit is contained in:
43
pkg/integration/tests/sync/pull.go
Normal file
43
pkg/integration/tests/sync/pull.go
Normal file
@@ -0,0 +1,43 @@
|
||||
package sync
|
||||
|
||||
import (
|
||||
"github.com/jesseduffield/lazygit/pkg/config"
|
||||
. "github.com/jesseduffield/lazygit/pkg/integration/components"
|
||||
)
|
||||
|
||||
var Pull = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
Description: "Pull a commit from the remote",
|
||||
ExtraCmdArgs: "",
|
||||
Skip: false,
|
||||
SetupConfig: func(config *config.AppConfig) {
|
||||
config.UserConfig.Git.AutoFetch = false
|
||||
},
|
||||
SetupRepo: func(shell *Shell) {
|
||||
shell.EmptyCommit("one")
|
||||
shell.EmptyCommit("two")
|
||||
|
||||
shell.CloneIntoRemote("origin")
|
||||
shell.SetBranchUpstream("master", "origin/master")
|
||||
|
||||
// remove the 'two' commit so that we have something to pull from the remote
|
||||
shell.HardReset("HEAD^")
|
||||
},
|
||||
Run: func(t *TestDriver, keys config.KeybindingConfig) {
|
||||
t.Views().Commits().
|
||||
Lines(
|
||||
Contains("one"),
|
||||
)
|
||||
|
||||
t.Views().Status().Content(Contains("↓1 repo → master"))
|
||||
|
||||
t.Views().Files().IsFocused().Press(keys.Universal.Pull)
|
||||
|
||||
t.Views().Commits().
|
||||
Lines(
|
||||
Contains("two"),
|
||||
Contains("one"),
|
||||
)
|
||||
|
||||
t.Views().Status().Content(Contains("✓ repo → master"))
|
||||
},
|
||||
})
|
@@ -72,5 +72,6 @@ var tests = []*components.IntegrationTest{
|
||||
submodule.Remove,
|
||||
submodule.Reset,
|
||||
sync.FetchPrune,
|
||||
sync.Pull,
|
||||
sync.RenameBranchAndPull,
|
||||
}
|
||||
|
@@ -1 +0,0 @@
|
||||
ref: refs/heads/master
|
@@ -1,8 +0,0 @@
|
||||
[core]
|
||||
repositoryformatversion = 0
|
||||
filemode = true
|
||||
bare = true
|
||||
ignorecase = true
|
||||
precomposeunicode = true
|
||||
[remote "origin"]
|
||||
url = /Users/jesseduffieldduffield/go/src/github.com/jesseduffield/lazygit/test/integration/pull/actual/./repo
|
@@ -1 +0,0 @@
|
||||
Unnamed repository; edit this file 'description' to name the repository.
|
@@ -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
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,2 +0,0 @@
|
||||
x<01><>A
|
||||
<EFBFBD>0@Ѯs<D1AE><73>Jƌ<4A>J\y<><79>L<EFBFBD><4C><EFBFBD>")<29><><EFBFBD>#t<>y<EFBFBD>S5[ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>S<EFBFBD><53><EFBFBD>ᮒ<EFBFBD><14><>`<17><0C>P<EFBFBD>L%<25><>s<EFBFBD><73>^u<>i<EFBFBD><69>4<EFBFBD><34><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=<01>$<24>p<1F><><EFBFBD><EFBFBD>;<3B>9i<39>'w<>+<2B><><EFBFBD>49,<2C>
|
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,3 +0,0 @@
|
||||
x<01><>A
|
||||
<EFBFBD> E<><45><14><0B>q4*<2A>R<EFBFBD>*<2A><>q<EFBFBD>j<13><><EFBFBD><EFBFBD><EFBFBD>]}x<><07><><EFBFBD>֮!<21>S?<3F><>-<10><>U<1C>d<EFBFBD>"<22>J4<0B>%?<3F>X<EFBFBD><58><EFBFBD>Wס<57><D7A1>@S<><53>J<EFBFBD><4A>A<>`<0B><>c
|
||||
<09><><EFBFBD><EFBFBD><EFBFBD>=/<2F>:/w<><77><EFBFBD>?<3F>B[<5B>i<EFBFBD>\D'<27><>`<60>t<><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD>W<EFBFBD>'<27><><01>};<3B>
|
@@ -1,2 +0,0 @@
|
||||
# pack-refs with: peeled fully-peeled sorted
|
||||
97bf06c598032ab5ad0faf744c91545071f3cb38 refs/heads/master
|
@@ -1 +0,0 @@
|
||||
myfile4
|
@@ -1 +0,0 @@
|
||||
97bf06c598032ab5ad0faf744c91545071f3cb38 branch 'master' of ../origin
|
@@ -1 +0,0 @@
|
||||
ref: refs/heads/master
|
@@ -1 +0,0 @@
|
||||
7b9a91f4ecba02fd55dbf3f372bc3faee3897939
|
@@ -1,16 +0,0 @@
|
||||
[core]
|
||||
repositoryformatversion = 0
|
||||
filemode = true
|
||||
bare = false
|
||||
logallrefupdates = true
|
||||
ignorecase = true
|
||||
precomposeunicode = true
|
||||
[user]
|
||||
email = CI@example.com
|
||||
name = CI
|
||||
[remote "origin"]
|
||||
url = ../origin
|
||||
fetch = +refs/heads/*:refs/remotes/origin/*
|
||||
[branch "master"]
|
||||
remote = origin
|
||||
merge = refs/heads/master
|
@@ -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,7 +0,0 @@
|
||||
0000000000000000000000000000000000000000 3ea0c134bed03d0a2cb7eeaff586af277d137129 CI <CI@example.com> 1648348653 +1100 commit (initial): myfile1
|
||||
3ea0c134bed03d0a2cb7eeaff586af277d137129 7b9a91f4ecba02fd55dbf3f372bc3faee3897939 CI <CI@example.com> 1648348653 +1100 commit: myfile2
|
||||
7b9a91f4ecba02fd55dbf3f372bc3faee3897939 f0eb4a85b26f51dc8c23e31bb7f541f0e2d1d2d0 CI <CI@example.com> 1648348653 +1100 commit: myfile3
|
||||
f0eb4a85b26f51dc8c23e31bb7f541f0e2d1d2d0 97bf06c598032ab5ad0faf744c91545071f3cb38 CI <CI@example.com> 1648348653 +1100 commit: myfile4
|
||||
97bf06c598032ab5ad0faf744c91545071f3cb38 7b9a91f4ecba02fd55dbf3f372bc3faee3897939 CI <CI@example.com> 1648348653 +1100 reset: moving to HEAD~2
|
||||
7b9a91f4ecba02fd55dbf3f372bc3faee3897939 97bf06c598032ab5ad0faf744c91545071f3cb38 CI <CI@example.com> 1648348654 +1100 rebase -i (start): checkout 97bf06c598032ab5ad0faf744c91545071f3cb38
|
||||
97bf06c598032ab5ad0faf744c91545071f3cb38 97bf06c598032ab5ad0faf744c91545071f3cb38 CI <CI@example.com> 1648348654 +1100 rebase -i (finish): returning to refs/heads/master
|
@@ -1,6 +0,0 @@
|
||||
0000000000000000000000000000000000000000 3ea0c134bed03d0a2cb7eeaff586af277d137129 CI <CI@example.com> 1648348653 +1100 commit (initial): myfile1
|
||||
3ea0c134bed03d0a2cb7eeaff586af277d137129 7b9a91f4ecba02fd55dbf3f372bc3faee3897939 CI <CI@example.com> 1648348653 +1100 commit: myfile2
|
||||
7b9a91f4ecba02fd55dbf3f372bc3faee3897939 f0eb4a85b26f51dc8c23e31bb7f541f0e2d1d2d0 CI <CI@example.com> 1648348653 +1100 commit: myfile3
|
||||
f0eb4a85b26f51dc8c23e31bb7f541f0e2d1d2d0 97bf06c598032ab5ad0faf744c91545071f3cb38 CI <CI@example.com> 1648348653 +1100 commit: myfile4
|
||||
97bf06c598032ab5ad0faf744c91545071f3cb38 7b9a91f4ecba02fd55dbf3f372bc3faee3897939 CI <CI@example.com> 1648348653 +1100 reset: moving to HEAD~2
|
||||
7b9a91f4ecba02fd55dbf3f372bc3faee3897939 97bf06c598032ab5ad0faf744c91545071f3cb38 CI <CI@example.com> 1648348654 +1100 rebase -i (finish): refs/heads/master onto 97bf06c598032ab5ad0faf744c91545071f3cb38
|
@@ -1 +0,0 @@
|
||||
0000000000000000000000000000000000000000 97bf06c598032ab5ad0faf744c91545071f3cb38 CI <CI@example.com> 1648348653 +1100 fetch origin: storing head
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,2 +0,0 @@
|
||||
x<01><>A
|
||||
<EFBFBD>0@Ѯs<D1AE><73>Jƌ<4A>J\y<><79>L<EFBFBD><4C><EFBFBD>")<29><><EFBFBD>#t<>y<EFBFBD>S5[ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>S<EFBFBD><53><EFBFBD>ᮒ<EFBFBD><14><>`<17><0C>P<EFBFBD>L%<25><>s<EFBFBD><73>^u<>i<EFBFBD><69>4<EFBFBD><34><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=<01>$<24>p<1F><><EFBFBD><EFBFBD>;<3B>9i<39>'w<>+<2B><><EFBFBD>49,<2C>
|
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,3 +0,0 @@
|
||||
x<01><>A
|
||||
<EFBFBD> E<><45><14><0B>q4*<2A>R<EFBFBD>*<2A><>q<EFBFBD>j<13><><EFBFBD><EFBFBD><EFBFBD>]}x<><07><><EFBFBD>֮!<21>S?<3F><>-<10><>U<1C>d<EFBFBD>"<22>J4<0B>%?<3F>X<EFBFBD><58><EFBFBD>Wס<57><D7A1>@S<><53>J<EFBFBD><4A>A<>`<0B><>c
|
||||
<09><><EFBFBD><EFBFBD><EFBFBD>=/<2F>:/w<><77><EFBFBD>?<3F>B[<5B>i<EFBFBD>\D'<27><>`<60>t<><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD>W<EFBFBD>'<27><><01>};<3B>
|
@@ -1 +0,0 @@
|
||||
97bf06c598032ab5ad0faf744c91545071f3cb38
|
@@ -1 +0,0 @@
|
||||
97bf06c598032ab5ad0faf744c91545071f3cb38
|
@@ -1 +0,0 @@
|
||||
test1
|
@@ -1 +0,0 @@
|
||||
test2
|
@@ -1 +0,0 @@
|
||||
test3
|
@@ -1 +0,0 @@
|
||||
test4
|
@@ -1 +0,0 @@
|
||||
{"KeyEvents":[{"Timestamp":618,"Mod":0,"Key":256,"Ch":112},{"Timestamp":1225,"Mod":0,"Key":256,"Ch":113}],"ResizeEvents":[{"Timestamp":0,"Width":272,"Height":74}]}
|
@@ -1,36 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
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
|
||||
git add .
|
||||
git commit -am "myfile3"
|
||||
echo test4 > myfile4
|
||||
git add .
|
||||
git commit -am "myfile4"
|
||||
|
||||
cd ..
|
||||
git clone --bare ./repo origin
|
||||
|
||||
cd repo
|
||||
|
||||
# the test is to ensure that we actually can pull these two commits back from the origin
|
||||
git reset --hard HEAD~2
|
||||
git remote add origin ../origin
|
||||
git fetch origin
|
||||
git branch --set-upstream-to=origin/master master
|
@@ -1 +0,0 @@
|
||||
{ "description": "pull changes from the remote", "speed": 10 }
|
Reference in New Issue
Block a user