Merge branch 'db/svn-fe-code-purge' into svn-fe
[gitweb.git] / t / t5520-pull.sh
index 01f898e57a2197c6fb44b548c66b769af34be567..0e5eb678ce6b2f4fad79c39947455e5284313ba4 100755 (executable)
@@ -31,7 +31,7 @@ cd "$D"
 test_expect_success 'checking the results' '
        test -f file &&
        test -f cloned/file &&
-       diff file cloned/file
+       test_cmp file cloned/file
 '
 
 test_expect_success 'pulling into void using master:master' '
@@ -46,6 +46,17 @@ test_expect_success 'pulling into void using master:master' '
        test_cmp file cloned-uho/file
 '
 
+test_expect_success 'pulling into void does not overwrite untracked files' '
+       git init cloned-untracked &&
+       (
+               cd cloned-untracked &&
+               echo untracked >file &&
+               test_must_fail git pull .. master &&
+               echo untracked >expect &&
+               test_cmp expect file
+       )
+'
+
 test_expect_success 'test . as a remote' '
 
        git branch copy master &&
@@ -186,7 +197,7 @@ test_expect_success 'setup for detecting upstreamed changes' '
        )
 '
 
-test_expect_failure 'git pull --rebase detects upstreamed changes' '
+test_expect_success 'git pull --rebase detects upstreamed changes' '
        (cd dst &&
         git pull --rebase &&
         test -z "$(git ls-files -u)"
@@ -215,11 +226,18 @@ test_expect_success 'setup for avoiding reapplying old patches' '
        )
 '
 
-test_expect_failure 'git pull --rebase does not reapply old patches' '
+test_expect_success 'git pull --rebase does not reapply old patches' '
        (cd dst &&
         test_must_fail git pull --rebase &&
         test 1 = $(find .git/rebase-apply -name "000*" | wc -l)
        )
 '
 
+test_expect_success 'git pull --rebase against local branch' '
+       git checkout -b copy2 to-rebase-orig &&
+       git pull --rebase . to-rebase &&
+       test "conflicting modification" = "$(cat file)" &&
+       test file = "$(cat file2)"
+'
+
 test_done