X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft2012-checkout-last.sh;h=b44de9dc623fc923941b61719f445170602e21be;hb=38ca63f3c0ef70ba4e41d3b5e347e2c7e7d67fe5;hp=87b30a268c66848726baec5676e73b8db686806d;hpb=77f143bf3e218857ec8e5244d7e862e8e0c1a041;p=git.git diff --git a/t/t2012-checkout-last.sh b/t/t2012-checkout-last.sh index 87b30a268..b44de9dc6 100755 --- a/t/t2012-checkout-last.sh +++ b/t/t2012-checkout-last.sh @@ -1,6 +1,6 @@ #!/bin/sh -test_description='checkout can switch to last branch' +test_description='checkout can switch to last branch and merge base' . ./test-lib.sh @@ -91,4 +91,29 @@ test_expect_success 'switch to twelfth from the last' ' test "z$(git symbolic-ref HEAD)" = "zrefs/heads/branch13" ' +test_expect_success 'merge base test setup' ' + git checkout -b another other && + echo "hello again" >>world && + git add world && + git commit -m third +' + +test_expect_success 'another...master' ' + git checkout another && + git checkout another...master && + test "z$(git rev-parse --verify HEAD)" = "z$(git rev-parse --verify master^)" +' + +test_expect_success '...master' ' + git checkout another && + git checkout ...master && + test "z$(git rev-parse --verify HEAD)" = "z$(git rev-parse --verify master^)" +' + +test_expect_success 'master...' ' + git checkout another && + git checkout master... && + test "z$(git rev-parse --verify HEAD)" = "z$(git rev-parse --verify master^)" +' + test_done