grep: use return value of strbuf_detach()
[gitweb.git] / builtin / checkout.c
index 6123f732a2c84f975c576e7077a0c6da369e6b31..8d3ad7cd9e735fdece09793ec11995e7b91b5c6f 100644 (file)
@@ -126,6 +126,7 @@ static int update_some(const struct object_id *oid, struct strbuf *base,
        if (pos >= 0) {
                struct cache_entry *old = active_cache[pos];
                if (ce->ce_mode == old->ce_mode &&
+                   !ce_intent_to_add(old) &&
                    oideq(&ce->oid, &old->oid)) {
                        old->ce_flags |= CE_UPDATE;
                        discard_cache_entry(ce);