Merge branch 'jk/ident-loosen-getpwuid' into maint
[gitweb.git] / t / t5520-pull.sh
index af31f04c285c0a89af25353aba857a42bcc01124..a0013ee32f1940e32b4038d6cc9a39b218d794f1 100755 (executable)
@@ -160,6 +160,18 @@ test_expect_success 'fail if no configuration for current branch' '
        test "$(cat file)" = file
 '
 
+test_expect_success 'pull --all: fail if no configuration for current branch' '
+       git remote add test_remote . &&
+       test_when_finished "git remote remove test_remote" &&
+       git checkout -b test copy^ &&
+       test_when_finished "git checkout -f copy && git branch -D test" &&
+       test_config branch.test.remote test_remote &&
+       test "$(cat file)" = file &&
+       test_must_fail git pull --all 2>err &&
+       test_i18ngrep "There is no tracking information" err &&
+       test "$(cat file)" = file
+'
+
 test_expect_success 'fail if upstream branch does not exist' '
        git checkout -b test copy^ &&
        test_when_finished "git checkout -f copy && git branch -D test" &&
@@ -233,6 +245,17 @@ test_expect_success '--rebase fails with multiple branches' '
        test modified = "$(git show HEAD:file)"
 '
 
+test_expect_success 'pull --rebase succeeds with dirty working directory and rebase.autostash set' '
+       test_config rebase.autostash true &&
+       git reset --hard before-rebase &&
+       echo dirty >new_file &&
+       git add new_file &&
+       git pull --rebase . copy &&
+       test_cmp_rev HEAD^ copy &&
+       test "$(cat new_file)" = dirty &&
+       test "$(cat file)" = "modified again"
+'
+
 test_expect_success 'pull.rebase' '
        git reset --hard before-rebase &&
        test_config pull.rebase true &&
@@ -365,6 +388,14 @@ test_expect_success '--rebase with rebased upstream' '
 
 '
 
+test_expect_success '--rebase -f with rebased upstream' '
+       test_when_finished "test_might_fail git rebase --abort" &&
+       git reset --hard to-rebase-orig &&
+       git pull --rebase -f me copy &&
+       test "conflicting modification" = "$(cat file)" &&
+       test file = "$(cat file2)"
+'
+
 test_expect_success '--rebase with rebased default upstream' '
 
        git update-ref refs/remotes/me/copy copy-orig &&