aboutsummaryrefslogtreecommitdiff
path: root/t/t9301-fast-export.sh
diff options
context:
space:
mode:
authorAlexander Gavrilov <angavrilov@gmail.com>2008-07-19 16:21:24 +0400
committerJunio C Hamano <gitster@pobox.com>2008-07-19 11:25:51 -0700
commit03db4525d38119f7778d6e9117f27c47db8466d4 (patch)
treeee8126cbb922debfe445a54658c5a57dca4cc3ca /t/t9301-fast-export.sh
parent4a3fedd5976ae9175cc418876d17ca568278b426 (diff)
downloadgit-03db4525d38119f7778d6e9117f27c47db8466d4.tar.gz
git-03db4525d38119f7778d6e9117f27c47db8466d4.tar.xz
Support gitlinks in fast-import.
Currently fast-import/export cannot be used for repositories with submodules. This patch extends the relevant programs to make them correctly process gitlinks. Links can be represented by two forms of the Modify command: M 160000 SHA1 some/path which sets the link target explicitly, or M 160000 :mark some/path where the mark refers to a commit. The latter form can be used by importing tools to build all submodules simultaneously in one physical repository, and then simply fetch them apart. 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.sh42
1 files changed, 42 insertions, 0 deletions
diff --git a/t/t9301-fast-export.sh b/t/t9301-fast-export.sh
index 0959f2f81..8324f6e3b 100755
--- a/t/t9301-fast-export.sh
+++ b/t/t9301-fast-export.sh
@@ -143,4 +143,46 @@ test_expect_success 'signed-tags=strip' '
'
+test_expect_success 'setup submodule' '
+
+ git checkout -f master &&
+ mkdir sub &&
+ cd sub &&
+ git init &&
+ echo test file > file &&
+ git add file &&
+ git commit -m sub_initial &&
+ cd .. &&
+ git submodule add "`pwd`/sub" sub &&
+ git commit -m initial &&
+ test_tick &&
+ cd sub &&
+ echo more data >> file &&
+ git add file &&
+ git commit -m sub_second &&
+ cd .. &&
+ git add sub &&
+ git commit -m second
+
+'
+
+test_expect_success 'submodule fast-export | fast-import' '
+
+ SUBENT1=$(git ls-tree master^ sub) &&
+ SUBENT2=$(git ls-tree master sub) &&
+ rm -rf new &&
+ mkdir new &&
+ git --git-dir=new/.git init &&
+ git fast-export --signed-tags=strip --all |
+ (cd new &&
+ git fast-import &&
+ test "$SUBENT1" = "$(git ls-tree refs/heads/master^ sub)" &&
+ test "$SUBENT2" = "$(git ls-tree refs/heads/master sub)" &&
+ git checkout master &&
+ git submodule init &&
+ git submodule update &&
+ cmp sub/file ../sub/file)
+
+'
+
test_done