Code

fsck: --no-dangling omits "dangling object" information
[git.git] / cache-tree.c
index c1eacafd19ecc33f8782a241ca3fb887611dbc43..28ed6574a2faf3151056aa20e681e06a157e4a2d 100644 (file)
@@ -159,7 +159,7 @@ static int verify_cache(struct cache_entry **cache,
        funny = 0;
        for (i = 0; i < entries; i++) {
                struct cache_entry *ce = cache[i];
-               if (ce_stage(ce) || (ce->ce_flags & CE_INTENT_TO_ADD)) {
+               if (ce_stage(ce)) {
                        if (silent)
                                return -1;
                        if (10 < ++funny) {
@@ -339,8 +339,8 @@ static int update_one(struct cache_tree *it,
                                mode, sha1_to_hex(sha1), entlen+baselen, path);
                }
 
-               if (ce->ce_flags & CE_REMOVE)
-                       continue; /* entry being removed */
+               if (ce->ce_flags & (CE_REMOVE | CE_INTENT_TO_ADD))
+                       continue; /* entry being removed or placeholder */
 
                strbuf_grow(&buffer, entlen + 100);
                strbuf_addf(&buffer, "%o %.*s%c", mode, entlen, path + baselen, '\0');