summaryrefslogtreecommitdiff
path: root/t/t9300-fast-import.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-08-29 04:18:47 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-08-29 04:18:47 (GMT)
commit45792b64c1752d1b6736d0f49a8e4a003e458756 (patch)
tree212efd8a613c7a820666a1eda1bb9eba1117d5ab /t/t9300-fast-import.sh
parent0b98954975502f56f1de2a4cb0569f7e80fd44d0 (diff)
parent8fb3ad76b1782a5439343b9601f73a9287a245cf (diff)
downloadgit-45792b64c1752d1b6736d0f49a8e4a003e458756.zip
git-45792b64c1752d1b6736d0f49a8e4a003e458756.tar.gz
git-45792b64c1752d1b6736d0f49a8e4a003e458756.tar.bz2
Merge branch 'di/fast-import-deltified-tree'
* di/fast-import-deltified-tree: fast-import: prevent producing bad delta fast-import: add a test for tree delta base corruption
Diffstat (limited to 't/t9300-fast-import.sh')
-rwxr-xr-xt/t9300-fast-import.sh41
1 files changed, 41 insertions, 0 deletions
diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
index 4ef7624..dbe1099 100755
--- a/t/t9300-fast-import.sh
+++ b/t/t9300-fast-import.sh
@@ -833,6 +833,47 @@ test_expect_success \
git diff-tree --abbrev --raw L^ L >output &&
test_cmp expect output'
+cat >input <<INPUT_END
+blob
+mark :1
+data <<EOF
+the data
+EOF
+
+commit refs/heads/L2
+committer C O Mitter <committer@example.com> 1112912473 -0700
+data <<COMMIT
+init L2
+COMMIT
+M 644 :1 a/b/c
+M 644 :1 a/b/d
+M 644 :1 a/e/f
+
+commit refs/heads/L2
+committer C O Mitter <committer@example.com> 1112912473 -0700
+data <<COMMIT
+update L2
+COMMIT
+C a g
+C a/e g/b
+M 644 :1 g/b/h
+INPUT_END
+
+cat <<EOF >expect
+g/b/f
+g/b/h
+EOF
+
+test_expect_success \
+ 'L: nested tree copy does not corrupt deltas' \
+ 'git fast-import <input &&
+ git ls-tree L2 g/b/ >tmp &&
+ cat tmp | cut -f 2 >actual &&
+ test_cmp expect actual &&
+ git fsck `git rev-parse L2`'
+
+git update-ref -d refs/heads/L2
+
###
### series M
###