pack_if_possible_fn(): use ref_type() instead of is_per_worktree_ref()
[gitweb.git] / t / t3203-branch-output.sh
index f1ae5ff662efa3941748f29a7958f23d9519dda1..d3913f9088950a3ca848b8994abfddfecd3f6706 100755 (executable)
@@ -106,6 +106,19 @@ EOF
        test_i18ncmp expect actual
 '
 
+test_expect_success 'git branch shows detached HEAD properly after checkout --detach' '
+       git checkout master &&
+       cat >expect <<EOF &&
+* (HEAD detached at $(git rev-parse --short HEAD^0))
+  branch-one
+  branch-two
+  master
+EOF
+       git checkout --detach &&
+       git branch >actual &&
+       test_i18ncmp expect actual
+'
+
 test_expect_success 'git branch shows detached HEAD properly after moving' '
        cat >expect <<EOF &&
 * (HEAD detached from $(git rev-parse --short HEAD))
@@ -145,8 +158,8 @@ EOF
 
 test_expect_success 'git branch `--sort` option' '
        cat >expect <<-\EOF &&
-         branch-two
        * (HEAD detached from fromtag)
+         branch-two
          branch-one
          master
        EOF