Skip to content

Commit a418441

Browse files
Santi Béjargitster
authored andcommitted
t5520-pull: Test for rebased upstream + fetch + pull --rebase
If your upstream has rebased you can do: git pull --rebase but only if you haven't fetch before. Mark this case as test_expect_failure, in a later patch it will be changed to test_expect_success. Signed-off-by: Santi Béjar <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 4525e8e commit a418441

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

t/t5520-pull.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,20 @@ test_expect_success '--rebase with rebased default upstream' '
117117
118118
'
119119

120+
test_expect_failure 'rebased upstream + fetch + pull --rebase' '
121+
122+
git update-ref refs/remotes/me/copy copy-orig &&
123+
git reset --hard to-rebase-orig &&
124+
git checkout --track -b to-rebase3 me/copy &&
125+
git reset --hard to-rebase-orig &&
126+
git fetch &&
127+
test_must_fail git pull --rebase &&
128+
git rebase --abort &&
129+
test "conflicting modification" = "$(cat file)" &&
130+
test file = "$(cat file2)"
131+
132+
'
133+
120134
test_expect_success 'pull --rebase dies early with dirty working directory' '
121135
122136
git checkout to-rebase &&

0 commit comments

Comments
 (0)