summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ed5336a)
raw | patch | inline | side by side (parent: ed5336a)
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | |
Thu, 20 Aug 2009 13:47:06 +0000 (20:47 +0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 24 Aug 2009 00:13:33 +0000 (17:13 -0700) |
CE_REMOVE now removes both worktree and index versions. Sparse
checkout must be able to remove worktree version while keep the
index intact when checkout area is narrowed.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
checkout must be able to remove worktree version while keep the
index intact when checkout area is narrowed.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
cache.h | patch | blob | history | |
unpack-trees.c | patch | blob | history |
index f266246caf4b46c5740cbfcf951ee1ba00fe9fee..d3f81a1c7dc7dec4aadad2f9595bd66a47283828 100644 (file)
--- a/cache.h
+++ b/cache.h
#define CE_HASHED (0x100000)
#define CE_UNHASHED (0x200000)
+/* Only remove in work directory, not index */
+#define CE_WT_REMOVE (0x400000)
+
/*
* Extended on-disk flags
*/
diff --git a/unpack-trees.c b/unpack-trees.c
index dc6d74a16bd860709a5ede561b7b5c47d1b7b283..6a51a69b2a714525f5b73d6b9239de11a5a0c889 100644 (file)
--- a/unpack-trees.c
+++ b/unpack-trees.c
if (o->update && o->verbose_update) {
for (total = cnt = 0; cnt < index->cache_nr; cnt++) {
struct cache_entry *ce = index->cache[cnt];
- if (ce->ce_flags & (CE_UPDATE | CE_REMOVE))
+ if (ce->ce_flags & (CE_UPDATE | CE_REMOVE | CE_WT_REMOVE))
total++;
}
for (i = 0; i < index->cache_nr; i++) {
struct cache_entry *ce = index->cache[i];
+ if (ce->ce_flags & CE_WT_REMOVE) {
+ display_progress(progress, ++cnt);
+ if (o->update)
+ unlink_entry(ce);
+ continue;
+ }
+
if (ce->ce_flags & CE_REMOVE) {
display_progress(progress, ++cnt);
if (o->update)