summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2020-05-08 14:25:08 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2020-05-08 14:25:08 -0700
commit4c2941a5fa6c99cb204c48d2fe6f3b55a7211012 (patch)
treed82509c96a7eeb7260cbd46c423f4b1d978ac04b /t
parentMerge branch 'jk/arith-expansion-coding-guidelines' (diff)
parentrestore: default to HEAD when combining --staged and --worktree (diff)
downloadtgif-4c2941a5fa6c99cb204c48d2fe6f3b55a7211012.tar.xz
Merge branch 'es/restore-staged-from-head-by-default'
"git restore --staged --worktree" now defaults to take the contents out of "HEAD", instead of erring out. * es/restore-staged-from-head-by-default: restore: default to HEAD when combining --staged and --worktree
Diffstat (limited to 't')
-rwxr-xr-xt/t2070-restore.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/t/t2070-restore.sh b/t/t2070-restore.sh
index 076d0df7fc..89e5a142c9 100755
--- a/t/t2070-restore.sh
+++ b/t/t2070-restore.sh
@@ -69,6 +69,17 @@ test_expect_success 'restore --staged uses HEAD as source' '
test_cmp expected actual
'
+test_expect_success 'restore --worktree --staged uses HEAD as source' '
+ test_when_finished git reset --hard &&
+ git show HEAD:./first.t >expected &&
+ echo dirty >>first.t &&
+ git add first.t &&
+ git restore --worktree --staged first.t &&
+ git show :./first.t >actual &&
+ test_cmp expected actual &&
+ test_cmp expected first.t
+'
+
test_expect_success 'restore --ignore-unmerged ignores unmerged entries' '
git init unmerged &&
(