fast-import: treat filemodify with empty tree as delete
[gitweb.git] / fast-import.c
index ad6843a8b6cf0a59466a87a89a90165751923273..cd9310d1e5a5ac0cc6edf83c93c5f254fd579f64 100644 (file)
@@ -2163,6 +2163,12 @@ static void file_change_m(struct branch *b)
                p = uq.buf;
        }
 
+       /* Git does not track empty, non-toplevel directories. */
+       if (S_ISDIR(mode) && !memcmp(sha1, EMPTY_TREE_SHA1_BIN, 20) && *p) {
+               tree_content_remove(&b->branch_tree, p, NULL);
+               return;
+       }
+
        if (S_ISGITLINK(mode)) {
                if (inline_data)
                        die("Git links cannot be specified 'inline': %s",