Imported Upstream version 2.10.5
[platform/upstream/git.git] / t / t5521-pull-options.sh
index 453aba5..ded8f98 100755 (executable)
@@ -117,4 +117,52 @@ test_expect_success 'git pull --all' '
        )
 '
 
+test_expect_success 'git pull --dry-run' '
+       test_when_finished "rm -rf clonedry" &&
+       git init clonedry &&
+       (
+               cd clonedry &&
+               git pull --dry-run ../parent &&
+               test_path_is_missing .git/FETCH_HEAD &&
+               test_path_is_missing .git/refs/heads/master &&
+               test_path_is_missing .git/index &&
+               test_path_is_missing file
+       )
+'
+
+test_expect_success 'git pull --all --dry-run' '
+       test_when_finished "rm -rf cloneddry" &&
+       git init clonedry &&
+       (
+               cd clonedry &&
+               git remote add origin ../parent &&
+               git pull --all --dry-run &&
+               test_path_is_missing .git/FETCH_HEAD &&
+               test_path_is_missing .git/refs/remotes/origin/master &&
+               test_path_is_missing .git/index &&
+               test_path_is_missing file
+       )
+'
+
+test_expect_success 'git pull --allow-unrelated-histories' '
+       test_when_finished "rm -fr src dst" &&
+       git init src &&
+       (
+               cd src &&
+               test_commit one &&
+               test_commit two
+       ) &&
+       git clone src dst &&
+       (
+               cd src &&
+               git checkout --orphan side HEAD^ &&
+               test_commit three
+       ) &&
+       (
+               cd dst &&
+               test_must_fail git pull ../src side &&
+               git pull --allow-unrelated-histories ../src side
+       )
+'
+
 test_done