diff options
| author | Junio C Hamano <gitster@pobox.com> | 2019-07-09 15:25:44 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2019-07-09 15:25:44 -0700 |
| commit | f496b064fc1135e0dded7f93d85d72eb0b302c22 (patch) | |
| tree | 2149d0faf99c67ddd76a6d68125037f661db48a5 /t/t2014-checkout-switch.sh | |
| parent | b49d337bfbdd431697161244ff7b2241d9887c9f (diff) | |
| parent | 97ed685701a6df0273f7d29fd5bc0a0658a63cad (diff) | |
| download | git-f496b064fc1135e0dded7f93d85d72eb0b302c22.tar.gz | |
Merge branch 'nd/switch-and-restore'
Two new commands "git switch" and "git restore" are introduced to
split "checking out a branch to work on advancing its history" and
"checking out paths out of the index and/or a tree-ish to work on
advancing the current history" out of the single "git checkout"
command.
* nd/switch-and-restore: (46 commits)
completion: disable dwim on "git switch -d"
switch: allow to switch in the middle of bisect
t2027: use test_must_be_empty
Declare both git-switch and git-restore experimental
help: move git-diff and git-reset to different groups
doc: promote "git restore"
user-manual.txt: prefer 'merge --abort' over 'reset --hard'
completion: support restore
t: add tests for restore
restore: support --patch
restore: replace --force with --ignore-unmerged
restore: default to --source=HEAD when only --staged is specified
restore: reject invalid combinations with --staged
restore: add --worktree and --staged
checkout: factor out worktree checkout code
restore: disable overlay mode by default
restore: make pathspec mandatory
restore: take tree-ish from --source option instead
checkout: split part of it to new command 'restore'
doc: promote "git switch"
...
Diffstat (limited to 't/t2014-checkout-switch.sh')
| -rwxr-xr-x | t/t2014-checkout-switch.sh | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/t/t2014-checkout-switch.sh b/t/t2014-checkout-switch.sh new file mode 100755 index 0000000000..ccfb147113 --- /dev/null +++ b/t/t2014-checkout-switch.sh @@ -0,0 +1,28 @@ +#!/bin/sh + +test_description='Peter MacMillan' +. ./test-lib.sh + +test_expect_success setup ' + echo Hello >file && + git add file && + test_tick && + git commit -m V1 && + echo Hello world >file && + git add file && + git checkout -b other +' + +test_expect_success 'check all changes are staged' ' + git diff --exit-code +' + +test_expect_success 'second commit' ' + git commit -m V2 +' + +test_expect_success 'check' ' + git diff --cached --exit-code +' + +test_done |
