aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElijah Newren <newren@gmail.com>2009-06-25 22:48:32 -0600
committerJunio C Hamano <gitster@pobox.com>2009-06-27 14:10:10 -0700
commit25e0ca5dd61f8a4625393fa1b71e1f88c9fab754 (patch)
treeb5575e260569d608c4d02fb694f529258c7ae68b
parent2d8ad46919213ebbd7bb72eb5b56cca8cc3ae07f (diff)
downloadgit-25e0ca5dd61f8a4625393fa1b71e1f88c9fab754.tar.gz
git-25e0ca5dd61f8a4625393fa1b71e1f88c9fab754.tar.xz
Add new fast-export testcases
The testcases test the new --tag-of-filtered-object option, the output when limiting what to export by path, and test behavior when no exact-ref revision is included (e.g. master~8 present on command line but not master). Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xt/t9301-fast-export.sh88
1 files changed, 88 insertions, 0 deletions
diff --git a/t/t9301-fast-export.sh b/t/t9301-fast-export.sh
index 3f13e6b15..356964e53 100755
--- a/t/t9301-fast-export.sh
+++ b/t/t9301-fast-export.sh
@@ -262,6 +262,94 @@ test_expect_success 'cope with tagger-less tags' '
'
+test_expect_success 'setup for limiting exports by PATH' '
+ mkdir limit-by-paths &&
+ cd limit-by-paths &&
+ git init &&
+ echo hi > there &&
+ git add there &&
+ git commit -m "First file" &&
+ echo foo > bar &&
+ git add bar &&
+ git commit -m "Second file" &&
+ git tag -a -m msg mytag &&
+ echo morefoo >> bar &&
+ git add bar &&
+ git commit -m "Change to second file" &&
+ cd ..
+'
+
+cat > limit-by-paths/expected << EOF
+blob
+mark :1
+data 3
+hi
+
+reset refs/tags/mytag
+commit refs/tags/mytag
+mark :2
+author A U Thor <author@example.com> 1112912713 -0700
+committer C O Mitter <committer@example.com> 1112912713 -0700
+data 11
+First file
+M 100644 :1 there
+
+EOF
+
+test_expect_success 'dropping tag of filtered out object' '
+ cd limit-by-paths &&
+ git fast-export --tag-of-filtered-object=drop mytag -- there > output &&
+ test_cmp output expected &&
+ cd ..
+'
+
+cat >> limit-by-paths/expected << EOF
+tag mytag
+from :2
+tagger C O Mitter <committer@example.com> 1112912713 -0700
+data 4
+msg
+
+EOF
+
+test_expect_success 'rewriting tag of filtered out object' '
+ cd limit-by-paths &&
+ git fast-export --tag-of-filtered-object=rewrite mytag -- there > output &&
+ test_cmp output expected &&
+ cd ..
+'
+
+cat > limit-by-paths/expected << EOF
+blob
+mark :1
+data 4
+foo
+
+blob
+mark :2
+data 3
+hi
+
+reset refs/heads/master
+commit refs/heads/master
+mark :3
+author A U Thor <author@example.com> 1112912713 -0700
+committer C O Mitter <committer@example.com> 1112912713 -0700
+data 12
+Second file
+M 100644 :1 bar
+M 100644 :2 there
+
+EOF
+
+test_expect_failure 'no exact-ref revisions included' '
+ cd limit-by-paths &&
+ git fast-export master~2..master~1 > output &&
+ test_cmp output expected &&
+ cd ..
+'
+
+
test_expect_success 'set-up a few more tags for tag export tests' '
git checkout -f master &&
HEAD_TREE=`git show -s --pretty=raw HEAD | grep tree | sed "s/tree //"` &&