diff options
author | Junio C Hamano <gitster@pobox.com> | 2014-03-19 01:03:24 +0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-03-19 01:03:24 +0400 |
commit | 1f569775810be1655c284076082015168865d005 (patch) | |
tree | c773162fe6f354f2db976193410d107bff8acf45 /t/t7102-reset.sh | |
parent | a8b31316ef90153f148b685a802195885d5195f4 (diff) | |
parent | b7756d41dcc6720e6005b663bcb6f8b2f2a66763 (diff) |
Merge branch 'nd/reset-setup-worktree' into maint
"git reset" needs to refresh the index when working in a working
tree (it can also be used to match the index to the HEAD in an
otherwise bare repository), but it failed to set up the working
tree properly, causing GIT_WORK_TREE to be ignored.
* nd/reset-setup-worktree:
reset: optionally setup worktree and refresh index on --mixed
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 |