X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft2018-checkout-branch.sh;h=a42e03967b1df3001df24089f2c50008c092ac51;hb=b985f2aecaa6358b55d545385d0624d76ff83fb8;hp=fa69016381b0196c49472af51e36948ec7c5a2a9;hpb=187e902dd25da5a9f48f35a48e6281faa2f8ac39;p=git.git diff --git a/t/t2018-checkout-branch.sh b/t/t2018-checkout-branch.sh index fa6901638..a42e03967 100755 --- a/t/t2018-checkout-branch.sh +++ b/t/t2018-checkout-branch.sh @@ -169,4 +169,15 @@ test_expect_success 'checkout -f -B to an existing branch with mergeable changes test_must_fail test_dirty_mergeable ' +test_expect_success 'checkout -b ' ' + git tag -f -m "First commit" initial initial && + git checkout -f change1 && + name=$(git describe) && + git checkout -b $name && + git diff --exit-code change1 && + echo "refs/heads/$name" >expect && + git symbolic-ref HEAD >actual && + test_cmp expect actual +' + test_done