summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 22f77b7)
raw | patch | inline | side by side (parent: 22f77b7)
author | Linus Torvalds <torvalds@ppc970.osdl.org> | |
Thu, 9 Jun 2005 22:34:04 +0000 (15:34 -0700) | ||
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | |
Thu, 9 Jun 2005 22:34:04 +0000 (15:34 -0700) |
Only when "-u" is used of course.
read-cache.c | patch | blob | history | |
read-tree.c | patch | blob | history |
diff --git a/read-cache.c b/read-cache.c
index 0d949f691d598905b1774821965439f96e3348ce..d358933b26991408268c40c428eee75333793582 100644 (file)
--- a/read-cache.c
+++ b/read-cache.c
for (i = 0; i < entries; i++) {
struct cache_entry *ce = cache[i];
+ if (!ce->ce_mode)
+ continue;
if (ce_write(&c, newfd, ce, ce_size(ce)) < 0)
return -1;
}
diff --git a/read-tree.c b/read-tree.c
index b3a3c4ab5915d8da32515a6a4e28f96da76bb7e3..ee7a46c909efbc78c59b49d2147165297158882e 100644 (file)
--- a/read-tree.c
+++ b/read-tree.c
@@ -124,6 +124,15 @@ static int merged_entry(struct cache_entry *merge, struct cache_entry *old, stru
return 1;
}
+static int deleted_entry(struct cache_entry *ce, struct cache_entry *old, struct cache_entry **dst)
+{
+ if (old)
+ verify_uptodate(old);
+ ce->ce_mode = 0;
+ *dst++ = ce;
+ return 1;
+}
+
static int threeway_merge(struct cache_entry *stages[4], struct cache_entry **dst)
{
struct cache_entry *old = stages[0];
}
else if (oldtree && !newtree && same(current, oldtree)) {
/* 10 or 11 */
- verify_uptodate(current);
- return 0;
+ return deleted_entry(oldtree, current, dst);
}
else if (oldtree && newtree &&
same(current, oldtree) && !same(current, newtree)) {
/* 20 or 21 */
- verify_uptodate(current);
- return merged_entry(newtree, NULL, dst);
+ return merged_entry(newtree, current, dst);
}
else
/* all other failures */
return -1;
}
else if (newtree)
- return merged_entry(newtree, NULL, dst);
+ return merged_entry(newtree, current, dst);
else
- return 0;
+ return deleted_entry(oldtree, current, dst);
}
/*
unsigned short mask = htons(CE_UPDATE);
while (nr--) {
struct cache_entry *ce = *src++;
+ if (!ce->ce_mode) {
+ if (update)
+ unlink(ce->name);
+ continue;
+ }
if (ce->ce_flags & mask) {
ce->ce_flags &= ~mask;
if (update)