1
0
mirror of https://github.com/git/git.git synced 2025-04-04 21:48:36 +00:00
git/builtin
Thomas Rast 11c8a74a64 commit: write cache-tree data when writing index anyway
In prepare_index(), we refresh the index, and then write it to disk if
this changed the index data.  After running hooks we re-read the index
and compute the root tree sha1 with the cache-tree machinery.

This gives us a mostly free opportunity to write up-to-date cache-tree
data: we can compute it in prepare_index() immediately before writing
the index to disk.

If we do this, we were going to write the index anyway, and the later
cache-tree update has no further work to do.  If we don't do it, we
don't do any extra work, though we still don't have have cache-tree
data after the commit.

The only case that suffers badly is when the pre-commit hook changes
many trees in the index.  I'm writing this off as highly unusual.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-12-06 14:58:53 -08:00
..
2011-06-20 14:27:36 -07:00
2010-10-21 17:16:10 -07:00
2011-10-26 16:16:29 -07:00
2011-09-12 11:43:58 -07:00
2010-11-24 15:55:19 -08:00
2011-03-22 10:16:54 -07:00
2011-03-22 10:16:54 -07:00
2011-10-06 13:54:32 -07:00
2011-11-18 11:30:02 -08:00
2011-03-22 10:16:54 -07:00
2011-03-22 10:16:54 -07:00
2011-03-22 11:43:27 -07:00
2011-03-22 10:16:54 -07:00
2011-09-01 15:46:13 -07:00
2011-03-09 23:52:56 -08:00
2011-05-31 12:19:11 -07:00
2011-10-10 15:56:18 -07:00
2011-03-22 10:16:54 -07:00
2011-08-25 14:42:11 -07:00
2010-11-15 10:04:43 -08:00
2011-03-22 10:16:54 -07:00