]> git.ipfire.org Git - thirdparty/git.git/blobdiff - entry.c
Merge branch 'jc/add-i-use-builtin-experimental'
[thirdparty/git.git] / entry.c
diff --git a/entry.c b/entry.c
index 2afac33699ca8bd12e6f492932acd33558826a29..a0532f1f00007be7c9b675a54a7e8c48c000d638 100644 (file)
--- a/entry.c
+++ b/entry.c
@@ -263,6 +263,9 @@ static int write_entry(struct cache_entry *ce,
        size_t newsize = 0;
        struct stat st;
        const struct submodule *sub;
+       struct checkout_metadata meta;
+
+       clone_checkout_metadata(&meta, &state->meta, &ce->oid);
 
        if (ce_mode_s_ifmt == S_IFREG) {
                struct stream_filter *filter = get_stream_filter(state->istate, ce->name,
@@ -314,13 +317,13 @@ static int write_entry(struct cache_entry *ce,
                 */
                if (dco && dco->state != CE_NO_DELAY) {
                        ret = async_convert_to_working_tree(state->istate, ce->name, new_blob,
-                                                           size, &buf, dco);
+                                                           size, &buf, &meta, dco);
                        if (ret && string_list_has_string(&dco->paths, ce->name)) {
                                free(new_blob);
                                goto delayed;
                        }
                } else
-                       ret = convert_to_working_tree(state->istate, ce->name, new_blob, size, &buf);
+                       ret = convert_to_working_tree(state->istate, ce->name, new_blob, size, &buf, &meta);
 
                if (ret) {
                        free(new_blob);
@@ -507,8 +510,6 @@ int checkout_entry(struct cache_entry *ce, const struct checkout *state,
                        /* If it is a gitlink, leave it alone! */
                        if (S_ISGITLINK(ce->ce_mode))
                                return 0;
-                       if (!state->force)
-                               return error("%s is a directory", path.buf);
                        remove_subtree(&path);
                } else if (unlink(path.buf))
                        return error_errno("unable to unlink old '%s'", path.buf);