Code

revisions: split out handle_revision_pseudo_opt function
[git.git] / t / t7201-co.sh
index 1337fa5a2209d489c43f0a34c95a89053d3fd8bf..37ed0931d9499791a6b3336efb97385356df6157 100755 (executable)
@@ -223,7 +223,7 @@ test_expect_success 'checkout --merge --conflict=diff3 <branch>' '
        test_cmp two expect
 '
 
-test_expect_success 'checkout to detach HEAD (with advice declined)' '
+test_expect_success C_LOCALE_OUTPUT 'checkout to detach HEAD (with advice declined)' '
 
        git config advice.detachedHead false &&
        git checkout -f renamer && git clean -f &&
@@ -242,7 +242,7 @@ test_expect_success 'checkout to detach HEAD (with advice declined)' '
        fi
 '
 
-test_expect_success 'checkout to detach HEAD' '
+test_expect_success C_LOCALE_OUTPUT 'checkout to detach HEAD' '
        git config advice.detachedHead true &&
        git checkout -f renamer && git clean -f &&
        git checkout renamer^ 2>messages &&
@@ -260,7 +260,7 @@ test_expect_success 'checkout to detach HEAD' '
        fi
 '
 
-test_expect_success 'checkout to detach HEAD with branchname^' '
+test_expect_success C_LOCALE_OUTPUT 'checkout to detach HEAD with branchname^' '
 
        git checkout -f master && git clean -f &&
        git checkout renamer^ &&
@@ -276,7 +276,7 @@ test_expect_success 'checkout to detach HEAD with branchname^' '
        fi
 '
 
-test_expect_success 'checkout to detach HEAD with :/message' '
+test_expect_success C_LOCALE_OUTPUT 'checkout to detach HEAD with :/message' '
 
        git checkout -f master && git clean -f &&
        git checkout ":/Initial" &&
@@ -292,7 +292,7 @@ test_expect_success 'checkout to detach HEAD with :/message' '
        fi
 '
 
-test_expect_success 'checkout to detach HEAD with HEAD^0' '
+test_expect_success C_LOCALE_OUTPUT 'checkout to detach HEAD with HEAD^0' '
 
        git checkout -f master && git clean -f &&
        git checkout HEAD^0 &&
@@ -408,6 +408,15 @@ test_expect_success 'checkout w/--track from non-branch HEAD fails' '
     test "z$(git rev-parse master^0)" = "z$(git rev-parse HEAD)"
 '
 
+test_expect_success 'checkout w/--track from tag fails' '
+    git checkout master^0 &&
+    test_must_fail git symbolic-ref HEAD &&
+    test_must_fail git checkout --track -b track frotz &&
+    test_must_fail git rev-parse --verify track &&
+    test_must_fail git symbolic-ref HEAD &&
+    test "z$(git rev-parse master^0)" = "z$(git rev-parse HEAD)"
+'
+
 test_expect_success 'detach a symbolic link HEAD' '
     git checkout master &&
     git config --bool core.prefersymlinkrefs yes &&
@@ -423,7 +432,6 @@ test_expect_success 'detach a symbolic link HEAD' '
 test_expect_success \
     'checkout with --track fakes a sensible -b <name>' '
     git update-ref refs/remotes/origin/koala/bear renamer &&
-    git update-ref refs/new/koala/bear renamer &&
 
     git checkout --track origin/koala/bear &&
     test "refs/heads/koala/bear" = "$(git symbolic-ref HEAD)" &&
@@ -439,12 +447,6 @@ test_expect_success \
 
     git checkout --track remotes/origin/koala/bear &&
     test "refs/heads/koala/bear" = "$(git symbolic-ref HEAD)" &&
-    test "$(git rev-parse HEAD)" = "$(git rev-parse renamer)" &&
-
-    git checkout master && git branch -D koala/bear &&
-
-    git checkout --track refs/new/koala/bear &&
-    test "refs/heads/koala/bear" = "$(git symbolic-ref HEAD)" &&
     test "$(git rev-parse HEAD)" = "$(git rev-parse renamer)"
 '