Merge branch 'mk/merge-in-sparse-checkout'
authorJunio C Hamano <gitster@pobox.com>
Tue, 24 Jul 2018 21:50:48 +0000 (14:50 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 24 Jul 2018 21:50:48 +0000 (14:50 -0700)
"git reset --merge" (hence "git merge ---abort") and "git reset --hard"
had trouble working correctly in a sparsely checked out working
tree after a conflict, which has been corrected.

* mk/merge-in-sparse-checkout:
  unpack-trees: do not fail reset because of unmerged skipped entry

1  2 
unpack-trees.c

diff --combined unpack-trees.c
@@@ -16,7 -16,6 +16,7 @@@
  #include "submodule.h"
  #include "submodule-config.h"
  #include "fsmonitor.h"
 +#include "object-store.h"
  #include "fetch-object.h"
  
  /*
@@@ -1247,7 -1246,7 +1247,7 @@@ static void mark_new_skip_worktree(stru
                if (select_flag && !(ce->ce_flags & select_flag))
                        continue;
  
-               if (!ce_stage(ce))
+               if (!ce_stage(ce) && !(ce->ce_flags & CE_CONFLICTED))
                        ce->ce_flags |= skip_wt_flag;
                else
                        ce->ce_flags &= ~skip_wt_flag;