]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t5520-pull.sh
Teach 'git pull' about --rebase
[thirdparty/git.git] / t / t5520-pull.sh
index 243212d3dac03c19db18e9c8fcfc3b9049137cdd..52b3a0c6dde59b8a955f28f4e9ffe037b0271513 100755 (executable)
@@ -53,5 +53,26 @@ test_expect_success 'the default remote . should not break explicit pull' '
        test `cat file` = modified
 '
 
-test_done
+test_expect_success '--rebase' '
+       git branch to-rebase &&
+       echo modified again > file &&
+       git commit -m file file &&
+       git checkout to-rebase &&
+       echo new > file2 &&
+       git add file2 &&
+       git commit -m "new file" &&
+       git tag before-rebase &&
+       git pull --rebase . copy &&
+       test $(git rev-parse HEAD^) = $(git rev-parse copy) &&
+       test new = $(git show HEAD:file2)
+'
 
+test_expect_success 'branch.to-rebase.rebase' '
+       git reset --hard before-rebase &&
+       git config branch.to-rebase.rebase 1 &&
+       git pull . copy &&
+       test $(git rev-parse HEAD^) = $(git rev-parse copy) &&
+       test new = $(git show HEAD:file2)
+'
+
+test_done