Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2014-02-16 06:28:03 +0400
committerJunio C Hamano <gitster@pobox.com>2014-02-19 02:40:23 +0400
commitb7756d41dcc6720e6005b663bcb6f8b2f2a66763 (patch)
treeec80ffdea3b9a1564c78cd749b30f0e87e440bad /t/t7102-reset.sh
parent7bbc4e8fdb33e0a8e42e77cc05460d4c4f615f4d (diff)
reset: optionally setup worktree and refresh index on --mixed
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-xt/t7102-reset.sh11
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