summaryrefslogtreecommitdiff
path: root/t/t9301-fast-export.sh
diff options
context:
space:
mode:
authorAlexander Gavrilov <angavrilov@gmail.com>2008-07-26 20:52:54 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-07-30 06:57:51 (GMT)
commitae7c5dcef92d46cfc8987fde2c264614fe475bd1 (patch)
tree0db309e33c6b47264c68a0e7685b88bb4bd668a7 /t/t9301-fast-export.sh
parent6b2fbaaffc5ec762eae5d23b58b1dc0a88e2275e (diff)
downloadgit-ae7c5dcef92d46cfc8987fde2c264614fe475bd1.zip
git-ae7c5dcef92d46cfc8987fde2c264614fe475bd1.tar.gz
git-ae7c5dcef92d46cfc8987fde2c264614fe475bd1.tar.bz2
Support copy and rename detection in fast-export.
Although it does not matter for Git itself, tools that export to systems that explicitly track copies and renames can benefit from such information. This patch makes fast-export output correct action logs when -M or -C are enabled. Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t9301-fast-export.sh')
-rwxr-xr-xt/t9301-fast-export.sh46
1 files changed, 46 insertions, 0 deletions
diff --git a/t/t9301-fast-export.sh b/t/t9301-fast-export.sh
index 8324f6e..c19b4a2 100755
--- a/t/t9301-fast-export.sh
+++ b/t/t9301-fast-export.sh
@@ -185,4 +185,50 @@ test_expect_success 'submodule fast-export | fast-import' '
'
+export GIT_AUTHOR_NAME='A U Thor'
+export GIT_COMMITTER_NAME='C O Mitter'
+
+test_expect_success 'setup copies' '
+
+ git config --unset i18n.commitencoding &&
+ git checkout -b copy rein &&
+ git mv file file3 &&
+ git commit -m move1 &&
+ test_tick &&
+ cp file2 file4 &&
+ git add file4 &&
+ git mv file2 file5 &&
+ git commit -m copy1 &&
+ test_tick &&
+ cp file3 file6 &&
+ git add file6 &&
+ git commit -m copy2 &&
+ test_tick &&
+ echo more text >> file6 &&
+ echo even more text >> file6 &&
+ git add file6 &&
+ git commit -m modify &&
+ test_tick &&
+ cp file6 file7 &&
+ echo test >> file7 &&
+ git add file7 &&
+ git commit -m copy_modify
+
+'
+
+test_expect_success 'fast-export -C -C | fast-import' '
+
+ ENTRY=$(git rev-parse --verify copy) &&
+ rm -rf new &&
+ mkdir new &&
+ git --git-dir=new/.git init &&
+ git fast-export -C -C --signed-tags=strip --all > output &&
+ grep "^C \"file6\" \"file7\"\$" output &&
+ cat output |
+ (cd new &&
+ git fast-import &&
+ test $ENTRY = $(git rev-parse --verify refs/heads/copy))
+
+'
+
test_done