diff options
author | Junio C Hamano <gitster@pobox.com> | 2015-07-13 14:02:18 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-07-13 14:02:19 -0700 |
commit | 799767cc98b2f8e6f82d0de4bef9b5e8fcc16e97 (patch) | |
tree | 6b4292f1c30feec0958156c66c1a724dc067be9e /t/t2025-checkout-to.sh | |
parent | Merge branch 'nd/multiple-work-trees' (diff) | |
parent | Revert "checkout: retire --ignore-other-worktrees in favor of --force" (diff) | |
download | tgif-799767cc98b2f8e6f82d0de4bef9b5e8fcc16e97.tar.xz |
Merge branch 'es/worktree-add'
Update to the "linked checkout" in 2.5.0-rc1.
Instead of "checkout --to" that does not do what "checkout"
normally does, move the functionality to "git worktree add".
* es/worktree-add: (24 commits)
Revert "checkout: retire --ignore-other-worktrees in favor of --force"
checkout: retire --ignore-other-worktrees in favor of --force
worktree: add: auto-vivify new branch when <branch> is omitted
worktree: add: make -b/-B default to HEAD when <branch> is omitted
worktree: extract basename computation to new function
checkout: require worktree unconditionally
checkout: retire --to option
tests: worktree: retrofit "checkout --to" tests for "worktree add"
worktree: add -b/-B options
worktree: add --detach option
worktree: add --force option
worktree: introduce "add" command
checkout: drop 'checkout_opts' dependency from prepare_linked_checkout
checkout: make --to unconditionally verbose
checkout: prepare_linked_checkout: drop now-unused 'new' argument
checkout: relocate --to's "no branch specified" check
checkout: fix bug with --to and relative HEAD
Documentation/git-worktree: add EXAMPLES section
Documentation/git-worktree: add high-level 'lock' overview
Documentation/git-worktree: split technical info from general description
...
Diffstat (limited to 't/t2025-checkout-to.sh')
-rwxr-xr-x | t/t2025-checkout-to.sh | 137 |
1 files changed, 0 insertions, 137 deletions
diff --git a/t/t2025-checkout-to.sh b/t/t2025-checkout-to.sh deleted file mode 100755 index a8d93366f6..0000000000 --- a/t/t2025-checkout-to.sh +++ /dev/null @@ -1,137 +0,0 @@ -#!/bin/sh - -test_description='test git checkout --to' - -. ./test-lib.sh - -test_expect_success 'setup' ' - test_commit init -' - -test_expect_success 'checkout --to not updating paths' ' - test_must_fail git checkout --to -- init.t -' - -test_expect_success 'checkout --to an existing worktree' ' - mkdir -p existing/subtree && - test_must_fail git checkout --detach --to existing master -' - -test_expect_success 'checkout --to an existing empty worktree' ' - mkdir existing_empty && - git checkout --detach --to existing_empty master -' - -test_expect_success 'checkout --to refuses to checkout locked branch' ' - test_must_fail git checkout --to zere master && - ! test -d zere && - ! test -d .git/worktrees/zere -' - -test_expect_success 'checking out paths not complaining about linked checkouts' ' - ( - cd existing_empty && - echo dirty >>init.t && - git checkout master -- init.t - ) -' - -test_expect_success 'checkout --to a new worktree' ' - git rev-parse HEAD >expect && - git checkout --detach --to here master && - ( - cd here && - test_cmp ../init.t init.t && - test_must_fail git symbolic-ref HEAD && - git rev-parse HEAD >actual && - test_cmp ../expect actual && - git fsck - ) -' - -test_expect_success 'checkout --to a new worktree from a subdir' ' - ( - mkdir sub && - cd sub && - git checkout --detach --to here master && - cd here && - test_cmp ../../init.t init.t - ) -' - -test_expect_success 'checkout --to from a linked checkout' ' - ( - cd here && - git checkout --detach --to nested-here master && - cd nested-here && - git fsck - ) -' - -test_expect_success 'checkout --to a new worktree creating new branch' ' - git checkout --to there -b newmaster master && - ( - cd there && - test_cmp ../init.t init.t && - git symbolic-ref HEAD >actual && - echo refs/heads/newmaster >expect && - test_cmp expect actual && - git fsck - ) -' - -test_expect_success 'die the same branch is already checked out' ' - ( - cd here && - test_must_fail git checkout newmaster - ) -' - -test_expect_success 'not die the same branch is already checked out' ' - ( - cd here && - git checkout --ignore-other-worktrees --to anothernewmaster newmaster - ) -' - -test_expect_success 'not die on re-checking out current branch' ' - ( - cd there && - git checkout newmaster - ) -' - -test_expect_success 'checkout --to from a bare repo' ' - ( - git clone --bare . bare && - cd bare && - git checkout --to ../there2 -b bare-master master - ) -' - -test_expect_success 'checkout from a bare repo without --to' ' - ( - cd bare && - test_must_fail git checkout master - ) -' - -test_expect_success 'checkout with grafts' ' - test_when_finished rm .git/info/grafts && - test_commit abc && - SHA1=`git rev-parse HEAD` && - test_commit def && - test_commit xyz && - echo "`git rev-parse HEAD` $SHA1" >.git/info/grafts && - cat >expected <<-\EOF && - xyz - abc - EOF - git log --format=%s -2 >actual && - test_cmp expected actual && - git checkout --detach --to grafted master && - git --git-dir=grafted/.git log --format=%s -2 >actual && - test_cmp expected actual -' - -test_done |