diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2008-07-19 16:21:24 +0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-07-19 11:25:51 -0700 |
commit | 03db4525d38119f7778d6e9117f27c47db8466d4 (patch) | |
tree | ee8126cbb922debfe445a54658c5a57dca4cc3ca /t/t9301-fast-export.sh | |
parent | 4a3fedd5976ae9175cc418876d17ca568278b426 (diff) | |
download | git-03db4525d38119f7778d6e9117f27c47db8466d4.tar.gz |
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-x | t/t9301-fast-export.sh | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/t/t9301-fast-export.sh b/t/t9301-fast-export.sh index 0959f2f815..8324f6e3bd 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 |