mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-11-29 22:48:24 +02:00
add tests for dealing with remotes
This commit is contained in:
@@ -0,0 +1 @@
|
||||
myfile4
|
||||
@@ -0,0 +1 @@
|
||||
148a38f7ce513079d6cd40e4a02f11e46ea2ba6b branch 'master' of ../actual_remote
|
||||
1
test/integration/setUpstream/expected/.git_keep/HEAD
Normal file
1
test/integration/setUpstream/expected/.git_keep/HEAD
Normal file
@@ -0,0 +1 @@
|
||||
ref: refs/heads/master
|
||||
@@ -0,0 +1 @@
|
||||
058c8904c25889dd77ee3e817325fd1a28134037
|
||||
16
test/integration/setUpstream/expected/.git_keep/config
Normal file
16
test/integration/setUpstream/expected/.git_keep/config
Normal file
@@ -0,0 +1,16 @@
|
||||
[core]
|
||||
repositoryformatversion = 0
|
||||
filemode = true
|
||||
bare = false
|
||||
logallrefupdates = true
|
||||
ignorecase = true
|
||||
precomposeunicode = true
|
||||
[user]
|
||||
email = CI@example.com
|
||||
name = CI
|
||||
[remote "origin"]
|
||||
url = ../actual_remote
|
||||
fetch = +refs/heads/*:refs/remotes/origin/*
|
||||
[branch "master"]
|
||||
remote = origin
|
||||
merge = refs/heads/master
|
||||
@@ -0,0 +1 @@
|
||||
Unnamed repository; edit this file 'description' to name the repository.
|
||||
BIN
test/integration/setUpstream/expected/.git_keep/index
Normal file
BIN
test/integration/setUpstream/expected/.git_keep/index
Normal file
Binary file not shown.
@@ -0,0 +1,7 @@
|
||||
# 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
|
||||
@@ -0,0 +1,6 @@
|
||||
0000000000000000000000000000000000000000 7d7da1f440cca8d28eaf4b46e63f207993562b84 CI <CI@example.com> 1634898072 +1100 commit (initial): myfile1
|
||||
7d7da1f440cca8d28eaf4b46e63f207993562b84 058c8904c25889dd77ee3e817325fd1a28134037 CI <CI@example.com> 1634898072 +1100 commit: myfile2
|
||||
058c8904c25889dd77ee3e817325fd1a28134037 409dd039b9ec270067678ae23b710c8e4c49c458 CI <CI@example.com> 1634898072 +1100 commit: myfile3
|
||||
409dd039b9ec270067678ae23b710c8e4c49c458 148a38f7ce513079d6cd40e4a02f11e46ea2ba6b CI <CI@example.com> 1634898072 +1100 commit: myfile4
|
||||
148a38f7ce513079d6cd40e4a02f11e46ea2ba6b 058c8904c25889dd77ee3e817325fd1a28134037 CI <CI@example.com> 1634898072 +1100 reset: moving to HEAD~2
|
||||
058c8904c25889dd77ee3e817325fd1a28134037 148a38f7ce513079d6cd40e4a02f11e46ea2ba6b CI <CI@example.com> 1634898082 +1100 pull --no-edit: Fast-forward
|
||||
@@ -0,0 +1,6 @@
|
||||
0000000000000000000000000000000000000000 7d7da1f440cca8d28eaf4b46e63f207993562b84 CI <CI@example.com> 1634898072 +1100 commit (initial): myfile1
|
||||
7d7da1f440cca8d28eaf4b46e63f207993562b84 058c8904c25889dd77ee3e817325fd1a28134037 CI <CI@example.com> 1634898072 +1100 commit: myfile2
|
||||
058c8904c25889dd77ee3e817325fd1a28134037 409dd039b9ec270067678ae23b710c8e4c49c458 CI <CI@example.com> 1634898072 +1100 commit: myfile3
|
||||
409dd039b9ec270067678ae23b710c8e4c49c458 148a38f7ce513079d6cd40e4a02f11e46ea2ba6b CI <CI@example.com> 1634898072 +1100 commit: myfile4
|
||||
148a38f7ce513079d6cd40e4a02f11e46ea2ba6b 058c8904c25889dd77ee3e817325fd1a28134037 CI <CI@example.com> 1634898072 +1100 reset: moving to HEAD~2
|
||||
058c8904c25889dd77ee3e817325fd1a28134037 148a38f7ce513079d6cd40e4a02f11e46ea2ba6b CI <CI@example.com> 1634898082 +1100 pull --no-edit: Fast-forward
|
||||
@@ -0,0 +1 @@
|
||||
0000000000000000000000000000000000000000 148a38f7ce513079d6cd40e4a02f11e46ea2ba6b CI <CI@example.com> 1634898079 +1100 fetch origin: storing head
|
||||
@@ -0,0 +1,2 @@
|
||||
x��A
|
||||
�0@Q�9E��$��$"BW=Ƥ�`��R"����~���kkK����wU+1����+E�2��L���*�'�ɮ�nc�E|Et�,�@R����B��@�y�Ǻ�q��q��G���˼���0qr��{��Q���rӾuy*�ݜ:<
|
||||
Binary file not shown.
@@ -0,0 +1,3 @@
|
||||
x��A
|
||||
�0@Ѯs��e&�L& ���c�8R�T����#t�y�_�Z�f1ѥ��͌� � /3҈�A����PrHh�|��Y�4M�Ә�����du~�E�
|
||||
�BAL~��v�~�]?<������l�n�=I��^�Yϩ�rS���*���8M
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,3 @@
|
||||
x��A
|
||||
� E����q4�J!�Ì#
|
||||
�&������x<>ﵮMCt�v�h�@@�rq�%9,%e�B�iA�����#��j�xb�Ʊ�D1�DP�G�/�%@g0��n���Ӭ�i~�'�c����a@G�L��
|
||||
@@ -0,0 +1,3 @@
|
||||
x��A
|
||||
�0@Q�9��ɤ�d
|
||||
"BW=�4�`�!R"����~��j]; ���f��S��KM2��p�%�BCf*�����?���i~�G�k�Kj���(>8#z��zL���]��u3t?4A,�
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
|
||||
148a38f7ce513079d6cd40e4a02f11e46ea2ba6b
|
||||
@@ -0,0 +1 @@
|
||||
148a38f7ce513079d6cd40e4a02f11e46ea2ba6b
|
||||
1
test/integration/setUpstream/expected/myfile1
Normal file
1
test/integration/setUpstream/expected/myfile1
Normal file
@@ -0,0 +1 @@
|
||||
test1
|
||||
1
test/integration/setUpstream/expected/myfile2
Normal file
1
test/integration/setUpstream/expected/myfile2
Normal file
@@ -0,0 +1 @@
|
||||
test2
|
||||
1
test/integration/setUpstream/expected/myfile3
Normal file
1
test/integration/setUpstream/expected/myfile3
Normal file
@@ -0,0 +1 @@
|
||||
test3
|
||||
1
test/integration/setUpstream/expected/myfile4
Normal file
1
test/integration/setUpstream/expected/myfile4
Normal file
@@ -0,0 +1 @@
|
||||
test4
|
||||
1
test/integration/setUpstream/expected_remote/HEAD
Normal file
1
test/integration/setUpstream/expected_remote/HEAD
Normal file
@@ -0,0 +1 @@
|
||||
ref: refs/heads/master
|
||||
8
test/integration/setUpstream/expected_remote/config
Normal file
8
test/integration/setUpstream/expected_remote/config
Normal file
@@ -0,0 +1,8 @@
|
||||
[core]
|
||||
repositoryformatversion = 0
|
||||
filemode = true
|
||||
bare = true
|
||||
ignorecase = true
|
||||
precomposeunicode = true
|
||||
[remote "origin"]
|
||||
url = /Users/jesseduffieldduffield/go/src/github.com/jesseduffield/lazygit/test/integration/setUpstream/./actual
|
||||
1
test/integration/setUpstream/expected_remote/description
Normal file
1
test/integration/setUpstream/expected_remote/description
Normal file
@@ -0,0 +1 @@
|
||||
Unnamed repository; edit this file 'description' to name the repository.
|
||||
@@ -0,0 +1,7 @@
|
||||
# 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
|
||||
@@ -0,0 +1,2 @@
|
||||
x��A
|
||||
�0@Q�9E��$��$"BW=Ƥ�`��R"����~���kkK����wU+1����+E�2��L���*�'�ɮ�nc�E|Et�,�@R����B��@�y�Ǻ�q��q��G���˼���0qr��{��Q���rӾuy*�ݜ:<
|
||||
Binary file not shown.
@@ -0,0 +1,3 @@
|
||||
x��A
|
||||
�0@Ѯs��e&�L& ���c�8R�T����#t�y�_�Z�f1ѥ��͌� � /3҈�A����PrHh�|��Y�4M�Ә�����du~�E�
|
||||
�BAL~��v�~�]?<������l�n�=I��^�Yϩ�rS���*���8M
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,3 @@
|
||||
x��A
|
||||
� E����q4�J!�Ì#
|
||||
�&������x<>ﵮMCt�v�h�@@�rq�%9,%e�B�iA�����#��j�xb�Ʊ�D1�DP�G�/�%@g0��n���Ӭ�i~�'�c����a@G�L��
|
||||
@@ -0,0 +1,3 @@
|
||||
x��A
|
||||
�0@Q�9��ɤ�d
|
||||
"BW=�4�`�!R"����~��j]; ���f��S��KM2��p�%�BCf*�����?���i~�G�k�Kj���(>8#z��zL���]��u3t?4A,�
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2
test/integration/setUpstream/expected_remote/packed-refs
Normal file
2
test/integration/setUpstream/expected_remote/packed-refs
Normal file
@@ -0,0 +1,2 @@
|
||||
# pack-refs with: peeled fully-peeled sorted
|
||||
148a38f7ce513079d6cd40e4a02f11e46ea2ba6b refs/heads/master
|
||||
1
test/integration/setUpstream/recording.json
Normal file
1
test/integration/setUpstream/recording.json
Normal file
@@ -0,0 +1 @@
|
||||
{"KeyEvents":[{"Timestamp":555,"Mod":0,"Key":259,"Ch":0},{"Timestamp":1226,"Mod":0,"Key":256,"Ch":93},{"Timestamp":1731,"Mod":0,"Key":256,"Ch":110},{"Timestamp":1971,"Mod":0,"Key":256,"Ch":111},{"Timestamp":2131,"Mod":0,"Key":256,"Ch":114},{"Timestamp":2219,"Mod":0,"Key":256,"Ch":105},{"Timestamp":2274,"Mod":0,"Key":256,"Ch":103},{"Timestamp":2338,"Mod":0,"Key":256,"Ch":105},{"Timestamp":2418,"Mod":0,"Key":256,"Ch":110},{"Timestamp":2843,"Mod":0,"Key":13,"Ch":13},{"Timestamp":3379,"Mod":0,"Key":256,"Ch":46},{"Timestamp":3522,"Mod":0,"Key":256,"Ch":46},{"Timestamp":3690,"Mod":0,"Key":256,"Ch":47},{"Timestamp":3947,"Mod":0,"Key":256,"Ch":97},{"Timestamp":4105,"Mod":0,"Key":256,"Ch":99},{"Timestamp":4266,"Mod":0,"Key":256,"Ch":116},{"Timestamp":4338,"Mod":0,"Key":256,"Ch":117},{"Timestamp":4442,"Mod":0,"Key":256,"Ch":97},{"Timestamp":4530,"Mod":0,"Key":256,"Ch":108},{"Timestamp":4731,"Mod":0,"Key":256,"Ch":95},{"Timestamp":4915,"Mod":0,"Key":256,"Ch":114},{"Timestamp":4962,"Mod":0,"Key":256,"Ch":101},{"Timestamp":5041,"Mod":0,"Key":256,"Ch":109},{"Timestamp":5090,"Mod":0,"Key":256,"Ch":111},{"Timestamp":5146,"Mod":0,"Key":256,"Ch":116},{"Timestamp":5170,"Mod":0,"Key":256,"Ch":101},{"Timestamp":5443,"Mod":0,"Key":13,"Ch":13},{"Timestamp":6313,"Mod":0,"Key":256,"Ch":102},{"Timestamp":7171,"Mod":0,"Key":13,"Ch":13},{"Timestamp":7883,"Mod":0,"Key":256,"Ch":117},{"Timestamp":8459,"Mod":0,"Key":13,"Ch":13},{"Timestamp":9411,"Mod":0,"Key":256,"Ch":112},{"Timestamp":10298,"Mod":0,"Key":256,"Ch":113}],"ResizeEvents":[{"Timestamp":0,"Width":272,"Height":74}]}
|
||||
30
test/integration/setUpstream/setup.sh
Normal file
30
test/integration/setUpstream/setup.sh
Normal file
@@ -0,0 +1,30 @@
|
||||
#!/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
|
||||
git add .
|
||||
git commit -am "myfile3"
|
||||
echo test4 > myfile4
|
||||
git add .
|
||||
git commit -am "myfile4"
|
||||
|
||||
cd ..
|
||||
git clone --bare ./actual actual_remote
|
||||
|
||||
cd actual
|
||||
|
||||
git reset --hard HEAD~2
|
||||
1
test/integration/setUpstream/test.json
Normal file
1
test/integration/setUpstream/test.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "description": "allow setting the upstream of the current branch", "speed": 10 }
|
||||
Reference in New Issue
Block a user