Skip to content

Commit

Permalink
unpack-trees: be specific what part of the index has changed
Browse files Browse the repository at this point in the history
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Nguyễn Thái Ngọc Duy authored and Junio C Hamano committed Jun 13, 2014
1 parent 6c306a3 commit a5c446f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions unpack-trees.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,14 +246,18 @@ static int verify_absent_sparse(const struct cache_entry *ce,
enum unpack_trees_error_types,
struct unpack_trees_options *o);

static int apply_sparse_checkout(struct cache_entry *ce, struct unpack_trees_options *o)
static int apply_sparse_checkout(struct index_state *istate,
struct cache_entry *ce,
struct unpack_trees_options *o)
{
int was_skip_worktree = ce_skip_worktree(ce);

if (ce->ce_flags & CE_NEW_SKIP_WORKTREE)
ce->ce_flags |= CE_SKIP_WORKTREE;
else
ce->ce_flags &= ~CE_SKIP_WORKTREE;
if (was_skip_worktree != ce_skip_worktree(ce))
istate->cache_changed |= CE_ENTRY_CHANGED;

/*
* if (!was_skip_worktree && !ce_skip_worktree()) {
Expand Down Expand Up @@ -1131,7 +1135,7 @@ int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options
ret = -1;
}

if (apply_sparse_checkout(ce, o)) {
if (apply_sparse_checkout(&o->result, ce, o)) {
if (!o->show_all_errors)
goto return_failed;
ret = -1;
Expand Down

0 comments on commit a5c446f

Please sign in to comment.