diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2014-02-16 09:28:03 +0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-02-18 14:40:23 -0800 |
commit | b7756d41dcc6720e6005b663bcb6f8b2f2a66763 (patch) | |
tree | ec80ffdea3b9a1564c78cd749b30f0e87e440bad /t/t7102-reset.sh | |
parent | 7bbc4e8fdb33e0a8e42e77cc05460d4c4f615f4d (diff) | |
download | git-b7756d41dcc6720e6005b663bcb6f8b2f2a66763.tar.gz |
reset: optionally setup worktree and refresh index on --mixednd/reset-setup-worktree
Refreshing index requires work tree. So we have two options: always
set up work tree (and refuse to reset if failing to do so), or make
refreshing index optional.
As refreshing index is not the main task, it makes more sense to make
it optional. This allows us to still work in a bare repository to update
what is in the index.
Reported-by: Patrick Palka <patrick@parcs.ath.cx>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7102-reset.sh')
-rwxr-xr-x | t/t7102-reset.sh | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/t/t7102-reset.sh b/t/t7102-reset.sh index 8d4b50d1b5..ee117e2e72 100755 --- a/t/t7102-reset.sh +++ b/t/t7102-reset.sh @@ -535,4 +535,15 @@ test_expect_success 'reset with paths accepts tree' ' git diff HEAD --exit-code ' +test_expect_success 'reset --mixed sets up work tree' ' + git init mixed_worktree && + ( + cd mixed_worktree && + test_commit dummy + ) && + : >expect && + git --git-dir=mixed_worktree/.git --work-tree=mixed_worktree reset >actual && + test_cmp expect actual +' + test_done |