diff options
author | Dmitry Ivankov <divanorama@gmail.com> | 2011-08-15 00:32:24 +0600 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-08-14 14:40:01 -0700 |
commit | 8fb3ad76b1782a5439343b9601f73a9287a245cf (patch) | |
tree | 20be039763bddee81ceec02e8c6cf6ed87d63c21 /t/t9300-fast-import.sh | |
parent | 9a0edb79f2f00c79b9dced22f67d226f6bb9c741 (diff) | |
download | git-8fb3ad76b1782a5439343b9601f73a9287a245cf.tar.gz |
fast-import: prevent producing bad delta
To produce deltas for tree objects fast-import tracks two versions
of tree's entries - base and current one. Base version stands both
for a delta base of this tree, and for a entry inside a delta base
of a parent tree. So care should be taken to keep it in sync.
tree_content_set cuts away a whole subtree and replaces it with a
new one (or NULL for lazy load of a tree with known sha1). It
keeps a base sha1 for this subtree (needed for parent tree). And
here is the problem, 'subtree' tree root doesn't have the implied
base version entries.
Adjusting the subtree to include them would mean a deep rewrite of
subtree. Invalidating the subtree base version would mean recursive
invalidation of parents' base versions. So just mark this tree as
do-not-delta me. Abuse setuid bit for this purpose.
tree_content_replace is the same as tree_content_set except that is
is used to replace the root, so just clearing base sha1 here (instead
of setting the bit) is fine.
[di: log message]
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Dmitry Ivankov <divanorama@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t9300-fast-import.sh')
-rwxr-xr-x | t/t9300-fast-import.sh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh index c88ab467f8..b33bc8246d 100755 --- a/t/t9300-fast-import.sh +++ b/t/t9300-fast-import.sh @@ -765,7 +765,7 @@ g/b/f g/b/h EOF -test_expect_failure \ +test_expect_success \ 'L: nested tree copy does not corrupt deltas' \ 'git fast-import <input && git ls-tree L2 g/b/ >tmp && |