diff options
author | Junio C Hamano <gitster@pobox.com> | 2008-08-19 21:43:04 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-08-19 21:43:04 -0700 |
commit | 614eef259f0e805c7f656e1684b6a7ae56e1ee40 (patch) | |
tree | 6941085fb597d6fcf04897c9cc3c5ddaab2cf80a /t | |
parent | 652b0bbe09c909eb5aa34be8746071f1c5c0e73d (diff) | |
parent | bb0ceb6264fa1aea6e68e07cb13cd9a88473febb (diff) | |
download | git-614eef259f0e805c7f656e1684b6a7ae56e1ee40.tar.gz |
Merge branch 'js/checkout-dwim-local'
* js/checkout-dwim-local:
checkout --track: make up a sensible branch name if '-b' was omitted
Diffstat (limited to 't')
-rwxr-xr-x | t/t7201-co.sh | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/t/t7201-co.sh b/t/t7201-co.sh index 9ad5d635a2..943dd57aac 100755 --- a/t/t7201-co.sh +++ b/t/t7201-co.sh @@ -337,4 +337,15 @@ test_expect_success \ test refs/heads/delete-me = "$(git symbolic-ref HEAD)" && test_must_fail git checkout --track -b track' +test_expect_success \ + 'checkout with --track fakes a sensible -b <name>' ' + git update-ref refs/remotes/origin/koala/bear renamer && + git checkout --track origin/koala/bear && + test "refs/heads/koala/bear" = "$(git symbolic-ref HEAD)" && + test "$(git rev-parse HEAD)" = "$(git rev-parse renamer)"' + +test_expect_success \ + 'checkout with --track, but without -b, fails with too short tracked name' ' + test_must_fail git checkout --track renamer' + test_done |