@@ -197,7 +197,7 @@ test_expect_success 'read-tree will not throw away dirty changes, non-sparse' '
grep -q dirty init.t
'
-test_expect_failure 'read-tree will not throw away dirty changes, sparse' '
+test_expect_success 'read-tree will not throw away dirty changes, sparse' '
echo "/*" >.git/info/sparse-checkout &&
read_tree_u_must_succeed -m -u HEAD &&
@@ -2065,7 +2065,9 @@ static int verify_uptodate_1(const struct cache_entry *ce,
int verify_uptodate(const struct cache_entry *ce,
struct unpack_trees_options *o)
{
- if (!o->skip_sparse_checkout && (ce->ce_flags & CE_NEW_SKIP_WORKTREE))
+ if (!o->skip_sparse_checkout &&
+ (ce->ce_flags & CE_SKIP_WORKTREE) &&
+ (ce->ce_flags & CE_NEW_SKIP_WORKTREE))
return 0;
return verify_uptodate_1(ce, o, ERROR_NOT_UPTODATE_FILE);
}