]> asedeno.scripts.mit.edu Git - git.git/blobdiff - unpack-trees.c
gitignore(5): Allow "foo/" in ignore list to match directory "foo"
[git.git] / unpack-trees.c
index e9eb795d64b9cd6a6940995d41dd9c3f3239df02..11af2636c27b53d2fed14b71e16e6991892c241e 100644 (file)
@@ -523,7 +523,7 @@ static void verify_absent(struct cache_entry *ce, const char *action,
        if (!lstat(ce->name, &st)) {
                int cnt;
 
-               if (o->dir && excluded(o->dir, ce->name))
+               if (o->dir && excluded(o->dir, ce->name, ce_to_dtype(ce)))
                        /*
                         * ce->name is explicitly excluded, so it is Ok to
                         * overwrite it.
@@ -590,7 +590,7 @@ static int merged_entry(struct cache_entry *merge, struct cache_entry *old,
                 * a match.
                 */
                if (same(old, merge)) {
-                       *merge = *old;
+                       memcpy(merge, old, offsetof(struct cache_entry, name));
                } else {
                        verify_uptodate(old, o);
                        invalidate_ce_path(old);