]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/checkout.c
Merge branch 'bc/hash-transition-interop-part-1'
[thirdparty/git.git] / builtin / checkout.c
index 8a12b92c5f1bc7b9853df9af312f09e6b3118fe6..0bf61e6eef6fed12dfbc86e10b54651beb01db1e 100644 (file)
@@ -369,6 +369,9 @@ static int checkout_worktree(const struct checkout_opts *opts,
                               NULL);
 
        enable_delayed_checkout(&state);
+
+       /* TODO: audit for interaction with sparse-index. */
+       ensure_full_index(&the_index);
        for (pos = 0; pos < active_nr; pos++) {
                struct cache_entry *ce = active_cache[pos];
                if (ce->ce_flags & CE_MATCHED) {
@@ -513,6 +516,8 @@ static int checkout_paths(const struct checkout_opts *opts,
         * Make sure all pathspecs participated in locating the paths
         * to be checked out.
         */
+       /* TODO: audit for interaction with sparse-index. */
+       ensure_full_index(&the_index);
        for (pos = 0; pos < active_nr; pos++)
                if (opts->overlay_mode)
                        mark_ce_for_checkout_overlay(active_cache[pos],
@@ -602,6 +607,7 @@ static void show_local_changes(struct object *head,
        diff_setup_done(&rev.diffopt);
        add_pending_object(&rev, head, NULL);
        run_diff_index(&rev, 0);
+       object_array_clear(&rev.pending);
 }
 
 static void describe_detached_head(const char *msg, struct commit *commit)