t6036: avoid non-portable "cp -a"
[gitweb.git] / t / t5516-fetch-push.sh
index a2d4f375fc38f0cae255af4c06d17e51221914fa..7a8f56db53eb6c3b869d525501c186bd2df1ba0a 100755 (executable)
@@ -923,7 +923,7 @@ test_expect_success 'push into aliased refs (consistent)' '
        (
                cd child1 &&
                git branch foo &&
-               git symbolic-ref refs/heads/bar refs/heads/foo
+               git symbolic-ref refs/heads/bar refs/heads/foo &&
                git config receive.denyCurrentBranch false
        ) &&
        (
@@ -945,7 +945,7 @@ test_expect_success 'push into aliased refs (inconsistent)' '
        (
                cd child1 &&
                git branch foo &&
-               git symbolic-ref refs/heads/bar refs/heads/foo
+               git symbolic-ref refs/heads/bar refs/heads/foo &&
                git config receive.denyCurrentBranch false
        ) &&
        (
@@ -1015,7 +1015,7 @@ test_force_fetch_tag () {
        tag_type_description=$1
        tag_args=$2
 
-       test_expect_success "fetch will clobber an existing $tag_type_description" "
+       test_expect_success "fetch will not clobber an existing $tag_type_description without --force" "
                mk_test testrepo heads/master &&
                mk_child testrepo child1 &&
                mk_child testrepo child2 &&
@@ -1027,7 +1027,8 @@ test_force_fetch_tag () {
                        git add file1 &&
                        git commit -m 'file1' &&
                        git tag $tag_args testTag &&
-                       git -C ../child1 fetch origin tag testTag
+                       test_must_fail git -C ../child1 fetch origin tag testTag &&
+                       git -C ../child1 fetch origin '+refs/tags/*:refs/tags/*'
                )
        "
 }
@@ -1060,7 +1061,7 @@ test_expect_success 'push --porcelain rejected' '
        mk_empty testrepo &&
        git push testrepo refs/heads/master:refs/remotes/origin/master &&
        (cd testrepo &&
-               git reset --hard origin/master^
+               git reset --hard origin/master^ &&
                git config receive.denyCurrentBranch true) &&
 
        echo >.git/foo  "To testrepo"  &&
@@ -1074,7 +1075,7 @@ test_expect_success 'push --porcelain --dry-run rejected' '
        mk_empty testrepo &&
        git push testrepo refs/heads/master:refs/remotes/origin/master &&
        (cd testrepo &&
-               git reset --hard origin/master
+               git reset --hard origin/master &&
                git config receive.denyCurrentBranch true) &&
 
        echo >.git/foo  "To testrepo"  &&
@@ -1382,7 +1383,7 @@ test_expect_success 'push --follow-tag only pushes relevant tags' '
                git commit --allow-empty -m "future commit" &&
                git tag -m "future" future &&
                git checkout master &&
-               git for-each-ref refs/heads/master refs/tags/tag >../expect
+               git for-each-ref refs/heads/master refs/tags/tag >../expect &&
                git push --follow-tag ../dst master
        ) &&
        (