diff options
Diffstat (limited to 't/t7102-reset.sh')
-rwxr-xr-x | t/t7102-reset.sh | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/t/t7102-reset.sh b/t/t7102-reset.sh index 7d8fb188ee..d05426062e 100755 --- a/t/t7102-reset.sh +++ b/t/t7102-reset.sh @@ -75,14 +75,14 @@ test_expect_success 'reset --hard message' ' hex=$(git log -1 --format="%h") && git reset --hard >.actual && echo HEAD is now at $hex $(commit_msg) >.expected && - test_i18ncmp .expected .actual + test_cmp .expected .actual ' test_expect_success 'reset --hard message (ISO8859-1 logoutputencoding)' ' hex=$(git log -1 --format="%h") && git -c "i18n.logOutputEncoding=$test_encoding" reset --hard >.actual && echo HEAD is now at $hex $(commit_msg $test_encoding) >.expected && - test_i18ncmp .expected .actual + test_cmp .expected .actual ' test_expect_success 'giving a non existing revision should fail' ' @@ -469,7 +469,24 @@ test_expect_success '--mixed refreshes the index' ' EOF echo 123 >>file2 && git reset --mixed HEAD >output && - test_i18ncmp expect output + test_cmp expect output +' + +test_expect_success '--mixed preserves skip-worktree' ' + echo 123 >>file2 && + git add file2 && + git update-index --skip-worktree file2 && + git reset --mixed HEAD >output && + test_must_be_empty output && + + cat >expect <<-\EOF && + Unstaged changes after reset: + M file2 + EOF + git update-index --no-skip-worktree file2 && + git add file2 && + git reset --mixed HEAD >output && + test_cmp expect output ' test_expect_success 'resetting specific path that is unmerged' ' |