diff options
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 |