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,25 @@
|
||||
Merge branch 'master' of ../actual_remote
|
||||
|
||||
# Conflicts:
|
||||
# myfile4
|
||||
#
|
||||
# It looks like you may be committing a merge.
|
||||
# If this is not correct, please remove the file
|
||||
# /Users/jesseduffieldduffield/go/src/github.com/jesseduffield/lazygit/test/integration/pullMergeConflict/actual/.git/MERGE_HEAD
|
||||
# and try again.
|
||||
|
||||
|
||||
# Please enter the commit message for your changes. Lines starting
|
||||
# with '#' will be ignored, and an empty message aborts the commit.
|
||||
#
|
||||
# On branch master
|
||||
# Your branch and 'origin/master' have diverged,
|
||||
# and have 1 and 2 different commits each, respectively.
|
||||
# (use "git pull" to merge the remote branch into yours)
|
||||
#
|
||||
# All conflicts fixed but you are still merging.
|
||||
#
|
||||
# Changes to be committed:
|
||||
# new file: myfile3
|
||||
# modified: myfile4
|
||||
#
|
||||
@@ -0,0 +1 @@
|
||||
38699899bb94dfae74e3e55cf5bd6d92e6f3292a branch 'master' of ../actual_remote
|
||||
@@ -0,0 +1 @@
|
||||
ref: refs/heads/master
|
||||
@@ -0,0 +1 @@
|
||||
7dba68a0030313e27b8dd5da2076952629485f2d
|
||||
18
test/integration/pullMergeConflict/expected/.git_keep/config
Normal file
18
test/integration/pullMergeConflict/expected/.git_keep/config
Normal file
@@ -0,0 +1,18 @@
|
||||
[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
|
||||
[pull]
|
||||
rebase = false
|
||||
@@ -0,0 +1 @@
|
||||
Unnamed repository; edit this file 'description' to name the repository.
|
||||
BIN
test/integration/pullMergeConflict/expected/.git_keep/index
Normal file
BIN
test/integration/pullMergeConflict/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,7 @@
|
||||
0000000000000000000000000000000000000000 f0e8e7922de77a5ab20b924640c8b8435bae0b0b CI <CI@example.com> 1634896911 +1100 commit (initial): myfile1
|
||||
f0e8e7922de77a5ab20b924640c8b8435bae0b0b ddf4b7fe8f45d07a181c2b57cc3434c982d3f4aa CI <CI@example.com> 1634896911 +1100 commit: myfile2
|
||||
ddf4b7fe8f45d07a181c2b57cc3434c982d3f4aa 80f8aed01cdb61f9e94c6a53c39f400dfbcf05c9 CI <CI@example.com> 1634896911 +1100 commit: myfile3
|
||||
80f8aed01cdb61f9e94c6a53c39f400dfbcf05c9 38699899bb94dfae74e3e55cf5bd6d92e6f3292a CI <CI@example.com> 1634896911 +1100 commit: myfile4
|
||||
38699899bb94dfae74e3e55cf5bd6d92e6f3292a ddf4b7fe8f45d07a181c2b57cc3434c982d3f4aa CI <CI@example.com> 1634896911 +1100 reset: moving to head^^
|
||||
ddf4b7fe8f45d07a181c2b57cc3434c982d3f4aa 7dba68a0030313e27b8dd5da2076952629485f2d CI <CI@example.com> 1634896911 +1100 commit: myfile4 conflict
|
||||
7dba68a0030313e27b8dd5da2076952629485f2d 720c7e2dd34822d33cb24a0a3f0f4bdabf433500 CI <CI@example.com> 1634896916 +1100 commit (merge): Merge branch 'master' of ../actual_remote
|
||||
@@ -0,0 +1,7 @@
|
||||
0000000000000000000000000000000000000000 f0e8e7922de77a5ab20b924640c8b8435bae0b0b CI <CI@example.com> 1634896911 +1100 commit (initial): myfile1
|
||||
f0e8e7922de77a5ab20b924640c8b8435bae0b0b ddf4b7fe8f45d07a181c2b57cc3434c982d3f4aa CI <CI@example.com> 1634896911 +1100 commit: myfile2
|
||||
ddf4b7fe8f45d07a181c2b57cc3434c982d3f4aa 80f8aed01cdb61f9e94c6a53c39f400dfbcf05c9 CI <CI@example.com> 1634896911 +1100 commit: myfile3
|
||||
80f8aed01cdb61f9e94c6a53c39f400dfbcf05c9 38699899bb94dfae74e3e55cf5bd6d92e6f3292a CI <CI@example.com> 1634896911 +1100 commit: myfile4
|
||||
38699899bb94dfae74e3e55cf5bd6d92e6f3292a ddf4b7fe8f45d07a181c2b57cc3434c982d3f4aa CI <CI@example.com> 1634896911 +1100 reset: moving to head^^
|
||||
ddf4b7fe8f45d07a181c2b57cc3434c982d3f4aa 7dba68a0030313e27b8dd5da2076952629485f2d CI <CI@example.com> 1634896911 +1100 commit: myfile4 conflict
|
||||
7dba68a0030313e27b8dd5da2076952629485f2d 720c7e2dd34822d33cb24a0a3f0f4bdabf433500 CI <CI@example.com> 1634896916 +1100 commit (merge): Merge branch 'master' of ../actual_remote
|
||||
@@ -0,0 +1 @@
|
||||
0000000000000000000000000000000000000000 38699899bb94dfae74e3e55cf5bd6d92e6f3292a CI <CI@example.com> 1634896911 +1100 fetch origin: storing head
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,3 @@
|
||||
x��A
|
||||
�0@Q�9E���4�i"BW=F:�����D���#���ŗ�֥y�tj��'�PH�4!sL%D֞;
|
||||
QJ�趲�����2O��5�p�AB6�m�(ٕw{��Fƻ~Jݞz���<r��9#�3"�;�1��O��ז���259�
|
||||
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.
@@ -0,0 +1,2 @@
|
||||
x��A
|
||||
�0@Ѯs��JF�c��<ƘL���")���#t�y�S5[ ������S���5d"��9`'XZ��LEҽs�i���4�c�G���7��jO@�)D��pE�ޝ��4��;��uSt4M,�
|
||||
@@ -0,0 +1 @@
|
||||
720c7e2dd34822d33cb24a0a3f0f4bdabf433500
|
||||
@@ -0,0 +1 @@
|
||||
38699899bb94dfae74e3e55cf5bd6d92e6f3292a
|
||||
1
test/integration/pullMergeConflict/expected/myfile1
Normal file
1
test/integration/pullMergeConflict/expected/myfile1
Normal file
@@ -0,0 +1 @@
|
||||
test1
|
||||
1
test/integration/pullMergeConflict/expected/myfile2
Normal file
1
test/integration/pullMergeConflict/expected/myfile2
Normal file
@@ -0,0 +1 @@
|
||||
test2
|
||||
1
test/integration/pullMergeConflict/expected/myfile3
Normal file
1
test/integration/pullMergeConflict/expected/myfile3
Normal file
@@ -0,0 +1 @@
|
||||
test3
|
||||
1
test/integration/pullMergeConflict/expected/myfile4
Normal file
1
test/integration/pullMergeConflict/expected/myfile4
Normal file
@@ -0,0 +1 @@
|
||||
test4
|
||||
1
test/integration/pullMergeConflict/expected_remote/HEAD
Normal file
1
test/integration/pullMergeConflict/expected_remote/HEAD
Normal file
@@ -0,0 +1 @@
|
||||
ref: refs/heads/master
|
||||
@@ -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/pullMergeConflict/./actual
|
||||
@@ -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
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,3 @@
|
||||
x��A
|
||||
�0@Q�9E���4�i"BW=F:�����D���#���ŗ�֥y�tj��'�PH�4!sL%D֞;
|
||||
QJ�趲�����2O��5�p�AB6�m�(ٕw{��Fƻ~Jݞz���<r��9#�3"�;�1��O��ז���259�
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,2 @@
|
||||
x��A
|
||||
�0@Ѯs��JF�c��<ƘL���")���#t�y�S5[ ������S���5d"��9`'XZ��LEҽs�i���4�c�G���7��jO@�)D��pE�ޝ��4��;��uSt4M,�
|
||||
@@ -0,0 +1,2 @@
|
||||
# pack-refs with: peeled fully-peeled sorted
|
||||
38699899bb94dfae74e3e55cf5bd6d92e6f3292a refs/heads/master
|
||||
1
test/integration/pullMergeConflict/recording.json
Normal file
1
test/integration/pullMergeConflict/recording.json
Normal file
@@ -0,0 +1 @@
|
||||
{"KeyEvents":[{"Timestamp":1428,"Mod":0,"Key":256,"Ch":112},{"Timestamp":2571,"Mod":0,"Key":13,"Ch":13},{"Timestamp":3459,"Mod":0,"Key":13,"Ch":13},{"Timestamp":3852,"Mod":0,"Key":258,"Ch":0},{"Timestamp":4419,"Mod":0,"Key":256,"Ch":32},{"Timestamp":5267,"Mod":0,"Key":13,"Ch":13},{"Timestamp":6266,"Mod":0,"Key":256,"Ch":113}],"ResizeEvents":[{"Timestamp":0,"Width":272,"Height":74}]}
|
||||
40
test/integration/pullMergeConflict/setup.sh
Normal file
40
test/integration/pullMergeConflict/setup.sh
Normal file
@@ -0,0 +1,40 @@
|
||||
#!/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
|
||||
|
||||
echo conflict > myfile4
|
||||
git add .
|
||||
git commit -am "myfile4 conflict"
|
||||
|
||||
git remote add origin ../actual_remote
|
||||
git fetch origin
|
||||
git branch --set-upstream-to=origin/master master
|
||||
|
||||
git config pull.rebase false
|
||||
1
test/integration/pullMergeConflict/test.json
Normal file
1
test/integration/pullMergeConflict/test.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "description": "When user has configured pull with merge, ensure we handle conflicts", "speed": 5 }
|
||||
Reference in New Issue
Block a user