t5310-pack-bitmaps: fix bogus 'pack-objects to file can use bitmap' test
[gitweb.git] / t / t5510-fetch.sh
index 227dd70b7b966b1b73106262d7bf1593d343532f..e402aee6a22e64306c9f093ad1b529b3923fd65e 100755 (executable)
@@ -63,7 +63,7 @@ test_expect_success "fetch test" '
        git commit -a -m "updated by origin" &&
        cd two &&
        git fetch &&
-       test -f .git/refs/heads/one &&
+       git rev-parse --verify refs/heads/one &&
        mine=$(git rev-parse refs/heads/one) &&
        his=$(cd ../one && git rev-parse refs/heads/master) &&
        test "z$mine" = "z$his"
@@ -73,8 +73,8 @@ test_expect_success "fetch test for-merge" '
        cd "$D" &&
        cd three &&
        git fetch &&
-       test -f .git/refs/heads/two &&
-       test -f .git/refs/heads/one &&
+       git rev-parse --verify refs/heads/two &&
+       git rev-parse --verify refs/heads/one &&
        master_in_two=$(cd ../two && git rev-parse master) &&
        one_in_two=$(cd ../two && git rev-parse one) &&
        {
@@ -222,12 +222,9 @@ test_expect_success 'fetch uses remote ref names to describe new refs' '
        (
                cd descriptive &&
                git fetch o 2>actual &&
-               grep " -> refs/crazyheads/descriptive-branch$" actual |
-               test_i18ngrep "new branch" &&
-               grep " -> descriptive-tag$" actual |
-               test_i18ngrep "new tag" &&
-               grep " -> crazy$" actual |
-               test_i18ngrep "new ref"
+               test_i18ngrep "new branch.* -> refs/crazyheads/descriptive-branch$" actual &&
+               test_i18ngrep "new tag.* -> descriptive-tag$" actual &&
+               test_i18ngrep "new ref.* -> crazy$" actual
        ) &&
        git checkout master
 '
@@ -738,18 +735,15 @@ test_configured_prune unset unset unset true pruned  kept \
        "--prune origin +refs/heads/*:refs/remotes/origin/*"
 
 # Pruning that also takes place if a file:// url replaces a named
-# remote, with the exception of --prune-tags on the command-line
-# (arbitrary limitation).
-#
-# However, because there's no implicit
+# remote. However, because there's no implicit
 # +refs/heads/*:refs/remotes/origin/* refspec and supplying it on the
 # command-line negates --prune-tags, the branches will not be pruned.
 test_configured_prune_type unset unset unset unset kept   kept   "origin --prune-tags" "name"
 test_configured_prune_type unset unset unset unset kept   kept   "origin --prune-tags" "link"
 test_configured_prune_type unset unset unset unset pruned pruned "origin --prune --prune-tags" "name"
-test_configured_prune_type unset unset unset unset kept   kept   "origin --prune --prune-tags" "link"
+test_configured_prune_type unset unset unset unset kept   pruned "origin --prune --prune-tags" "link"
 test_configured_prune_type unset unset unset unset pruned pruned "--prune --prune-tags origin" "name"
-test_configured_prune_type unset unset unset unset kept   kept   "--prune --prune-tags origin" "link"
+test_configured_prune_type unset unset unset unset kept   pruned "--prune --prune-tags origin" "link"
 test_configured_prune_type unset unset true  unset pruned pruned "--prune origin" "name"
 test_configured_prune_type unset unset true  unset kept   pruned "--prune origin" "link"
 test_configured_prune_type unset unset unset true  pruned pruned "--prune origin" "name"
@@ -761,8 +755,9 @@ test_configured_prune_type unset  true true  unset kept   pruned "origin" "link"
 test_configured_prune_type unset  true unset true  pruned pruned "origin" "name"
 test_configured_prune_type unset  true unset true  kept   pruned "origin" "link"
 
-# Interaction between --prune-tags and no "fetch" config in the remote
-# at all.
+# When all remote.origin.fetch settings are deleted a --prune
+# --prune-tags still implicitly supplies refs/tags/*:refs/tags/* so
+# tags, but not tracking branches, will be deleted.
 test_expect_success 'remove remote.origin.fetch "one"' '
        (
                cd one &&
@@ -770,7 +765,7 @@ test_expect_success 'remove remote.origin.fetch "one"' '
        )
 '
 test_configured_prune_type unset unset unset unset kept pruned "origin --prune --prune-tags" "name"
-test_configured_prune_type unset unset unset unset kept kept   "origin --prune --prune-tags" "link"
+test_configured_prune_type unset unset unset unset kept pruned "origin --prune --prune-tags" "link"
 
 test_expect_success 'all boundary commits are excluded' '
        test_commit base &&
@@ -845,8 +840,8 @@ test_expect_success C_LOCALE_OUTPUT 'fetch aligned output' '
        test_commit looooooooooooong-tag &&
        (
                cd full-output &&
-               git -c fetch.output=full fetch origin 2>&1 | \
-                       grep -e "->" | cut -c 22- >../actual
+               git -c fetch.output=full fetch origin >actual 2>&1 &&
+               grep -e "->" actual | cut -c 22- >../actual
        ) &&
        cat >expect <<-\EOF &&
        master               -> origin/master
@@ -860,8 +855,8 @@ test_expect_success C_LOCALE_OUTPUT 'fetch compact output' '
        test_commit extraaa &&
        (
                cd compact &&
-               git -c fetch.output=compact fetch origin 2>&1 | \
-                       grep -e "->" | cut -c 22- >../actual
+               git -c fetch.output=compact fetch origin >actual 2>&1 &&
+               grep -e "->" actual | cut -c 22- >../actual
        ) &&
        cat >expect <<-\EOF &&
        master     -> origin/*