test-lib: turn off "-x" tracing during chain-lint check
[gitweb.git] / t / t5505-remote.sh
index 8f6e3922dce2b676221610d83a87c5b36d3bc5b6..7a8499ce665c74961fdbf6713c0b70c37f95f5e3 100755 (executable)
@@ -160,9 +160,7 @@ cat >test/expect <<EOF
 * remote two
   Fetch URL: ../two
   Push  URL: ../three
-  HEAD branch (remote HEAD is ambiguous, may be one of the following):
-    another
-    master
+  HEAD branch: master
   Local refs configured for 'git push':
     ahead  forces to master  (fast-forwardable)
     master pushes to another (up to date)
@@ -262,16 +260,12 @@ test_expect_success 'set-head --auto' '
        )
 '
 
-cat >test/expect <<\EOF
-error: Multiple remote HEAD branches. Please choose one explicitly with:
-  git remote set-head two another
-  git remote set-head two master
-EOF
-
-test_expect_success 'set-head --auto fails w/multiple HEADs' '
+test_expect_success 'set-head --auto has no problem w/multiple HEADs' '
        (
                cd test &&
-               test_must_fail git remote set-head --auto two >output 2>&1 &&
+               git fetch two "refs/heads/*:refs/remotes/two/*" &&
+               git remote set-head --auto two >output 2>&1 &&
+               echo "two/HEAD set to master" >expect &&
                test_i18ncmp expect output
        )
 '
@@ -585,7 +579,7 @@ test_expect_success 'update with arguments' '
                cd one &&
                for b in $(git branch -r)
                do
-               git branch -r -d $b || break
+               git branch -r -d $b || exit 1
                done &&
                git remote add manduca ../mirror &&
                git remote add megaloprepus ../mirror &&
@@ -628,7 +622,7 @@ test_expect_success 'update default' '
                cd one &&
                for b in $(git branch -r)
                do
-               git branch -r -d $b || break
+               git branch -r -d $b || exit 1
                done &&
                git config remote.drosophila.skipDefaultUpdate true &&
                git remote update default &&
@@ -648,7 +642,7 @@ test_expect_success 'update default (overridden, with funny whitespace)' '
                cd one &&
                for b in $(git branch -r)
                do
-               git branch -r -d $b || break
+               git branch -r -d $b || exit 1
                done &&
                git config remotes.default "$(printf "\t drosophila  \n")" &&
                git remote update default &&
@@ -662,7 +656,7 @@ test_expect_success 'update (with remotes.default defined)' '
                cd one &&
                for b in $(git branch -r)
                do
-               git branch -r -d $b || break
+               git branch -r -d $b || exit 1
                done &&
                git config remotes.default "drosophila" &&
                git remote update &&
@@ -1119,4 +1113,9 @@ test_extra_arg set-url origin newurl oldurl
 # prune takes any number of args
 # update takes any number of args
 
+test_expect_success 'add remote matching the "insteadOf" URL' '
+       git config url.xyz@example.com.insteadOf backup &&
+       git remote add backup xyz@example.com
+'
+
 test_done