summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 711f151)
raw | patch | inline | side by side (parent: 711f151)
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | |
Sat, 31 Jul 2010 06:14:29 +0000 (13:14 +0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 9 Aug 2010 19:16:02 +0000 (12:16 -0700) |
Sparse checkout narrows worktree down based on the skip-worktree bit
before and after $GIT_DIR/info/sparse-checkout application. If it does
not have that bit before but does after, a narrow is detected and the
file will be removed from worktree.
New files added by merge, however, does not have skip-worktree bit. If
those files appear to be outside checkout area, the same rule applies:
the file gets removed from worktree even though they don't exist in
worktree.
Just pretend they have skip-worktree before in that case, so the rule
is ignored.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
before and after $GIT_DIR/info/sparse-checkout application. If it does
not have that bit before but does after, a narrow is detected and the
file will be removed from worktree.
New files added by merge, however, does not have skip-worktree bit. If
those files appear to be outside checkout area, the same rule applies:
the file gets removed from worktree even though they don't exist in
worktree.
Just pretend they have skip-worktree before in that case, so the rule
is ignored.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t1011-read-tree-sparse-checkout.sh | patch | blob | history | |
unpack-trees.c | patch | blob | history |
index 85e08374dd7646365c10afaa4d2c5f092c33616a..9a07de1a5b6d3a98c0db0b24cdd9c3a68cef79b5 100755 (executable)
test ! -f sub/added
'
-test_expect_failure 'read-tree adds to worktree, dirty case' '
+test_expect_success 'read-tree adds to worktree, dirty case' '
echo init.t >.git/info/sparse-checkout &&
git checkout -f removed &&
mkdir sub &&
diff --git a/unpack-trees.c b/unpack-trees.c
index 7c9b0466c9cb9944ee5fe17e6445ac3657795f3f..8b162153229db5d5dadbdbcacca3754f77618bdf 100644 (file)
--- a/unpack-trees.c
+++ b/unpack-trees.c
if (!old) {
if (verify_absent(merge, "overwritten", o))
return -1;
+ if (!o->skip_sparse_checkout && will_have_skip_worktree(merge, o))
+ update |= CE_SKIP_WORKTREE;
invalidate_ce_path(merge, o);
} else if (!(old->ce_flags & CE_CONFLICTED)) {
/*