diff options
author | Junio C Hamano <gitster@pobox.com> | 2014-09-11 10:33:32 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-09-11 10:33:32 -0700 |
commit | 3fd13cbcd58f078476cabab926931a3d5bdedfe2 (patch) | |
tree | d8126c3dea8b3c7189165db37a6b7978480943e8 /builtin/checkout.c | |
parent | 01d678a2263c0c71e42475335b5b0b578936a7d1 (diff) | |
parent | 4ed115e9c545fb27a5b80c751b2c04ec7ecc4d97 (diff) | |
download | git-3fd13cbcd58f078476cabab926931a3d5bdedfe2.tar.gz |
Merge branch 'dt/cache-tree-repair'
Add a few more places in "commit" and "checkout" that make sure
that the cache-tree is fully populated in the index.
* dt/cache-tree-repair:
cache-tree: do not try to use an invalidated subtree info to build a tree
cache-tree: Write updated cache-tree after commit
cache-tree: subdirectory tests
test-dump-cache-tree: invalid trees are not errors
cache-tree: create/update cache-tree on checkout
Diffstat (limited to 'builtin/checkout.c')
-rw-r--r-- | builtin/checkout.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/builtin/checkout.c b/builtin/checkout.c index f71e74531d..8afdf2b5c4 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -552,6 +552,12 @@ static int merge_working_tree(const struct checkout_opts *opts, } } + if (!active_cache_tree) + active_cache_tree = cache_tree(); + + if (!cache_tree_fully_valid(active_cache_tree)) + cache_tree_update(&the_index, WRITE_TREE_SILENT | WRITE_TREE_REPAIR); + if (write_locked_index(&the_index, lock_file, COMMIT_LOCK)) die(_("unable to write new index file")); |