path.c: refactor relative_path(), not only strip prefix
[gitweb.git] / t / t3203-branch-output.sh
index f2b294b144a27917f495b434bfa66534527e9c7d..ba4f98e800f262242ef7925f82dc8d13272fe3ca 100755 (executable)
@@ -84,19 +84,23 @@ cat >expect <<'EOF'
 two
 one
 EOF
-test_expect_success 'git branch -v pattern shows branch summaries' '
-       git branch -v branch* >tmp &&
+test_expect_success 'git branch --list -v pattern shows branch summaries' '
+       git branch --list -v branch* >tmp &&
        awk "{print \$NF}" <tmp >actual &&
        test_cmp expect actual
 '
 
-cat >expect <<'EOF'
-* (no branch)
+test_expect_success 'git branch -v pattern does not show branch summaries' '
+       test_must_fail git branch -v branch*
+'
+
+test_expect_success 'git branch shows detached HEAD properly' '
+       cat >expect <<EOF &&
+* (detached from $(git rev-parse --short HEAD^0))
   branch-one
   branch-two
   master
 EOF
-test_expect_success 'git branch shows detached HEAD properly' '
        git checkout HEAD^0 &&
        git branch >actual &&
        test_i18ncmp expect actual