Imported Upstream version 2.13.4
[platform/upstream/git.git] / t / t5520-pull.sh
index 17f4d0f..f15f7a3 100755 (executable)
@@ -272,6 +272,24 @@ test_expect_success '--rebase fast forward' '
        test_cmp reflog.expected reflog.fuzzy
 '
 
+test_expect_success '--rebase --autostash fast forward' '
+       test_when_finished "
+               git reset --hard
+               git checkout to-rebase
+               git branch -D to-rebase-ff
+               git branch -D behind" &&
+       git branch behind &&
+       git checkout -b to-rebase-ff &&
+       echo another modification >>file &&
+       git add file &&
+       git commit -m mod &&
+
+       git checkout behind &&
+       echo dirty >file &&
+       git pull --rebase --autostash . to-rebase-ff &&
+       test "$(git rev-parse HEAD)" = "$(git rev-parse to-rebase-ff)"
+'
+
 test_expect_success '--rebase with conflicts shows advice' '
        test_when_finished "git rebase --abort; git checkout -f to-rebase" &&
        git checkout -b seq &&