# # add_file "tests/t_gitimport_suturing.at" # # patch "tests/t_gitimport_suturing.at" # from [] # to [7913aefc4b3944837c35ad095d9d491b520b32a2] # # patch "testsuite.at" # from [8b06359186b938753e93cc2f99be2ef4d8309209] # to [b34ea1d8820a9210c19d36aa27225fda184766f2] # ======================================================================== --- tests/t_gitimport_suturing.at +++ tests/t_gitimport_suturing.at 7913aefc4b3944837c35ad095d9d491b520b32a2 @@ -0,0 +1,66 @@ +# -*- Autoconf -*- + +AT_SETUP([importing more interesting GIT archive]) + +MONOTONE_SETUP + +AT_DATA(importme.0, [version 0 of test file +]) + +AT_DATA(importme.1, [version 1 of test file +]) + +AT_DATA(importme.2, [version 2 of test file +]) + +AT_DATA(importme.3, [version 3 of test file +]) + +TSHA0=`SHA1(importme.0)` +TSHA1=`SHA1(importme.1)` +TSHA2=`SHA1(importme.2)` +TSHA3=`SHA1(importme.3)` + +# build the git repository + +AT_CHECK(git-init-db, [], [ignore], [ignore]) +AT_CHECK(test -e .git) +AT_CHECK(test -e .git/refs) +AT_CHECK(test -e .git/refs/heads) + +# check out the working copy and make some commits + +AT_CHECK(cp importme.0 importme) +AT_CHECK(git-update-cache --add importme, [], [ignore], [ignore]) +AT_CHECK(echo 'commit 0' | git-commit-tree $(git-write-tree) >.git/HEAD, [], [ignore], [ignore]) +AT_CHECK(rm importme) +AT_CHECK(git-update-cache --remove importme, [], [ignore], [ignore]) +AT_CHECK(echo 'commit 2' | git-commit-tree $(git-write-tree) -p $(cat .git/HEAD) >.git/refs/heads/alt, [], [ignore], [ignore]) +AT_CHECK(cp importme.2 importme) +AT_CHECK(git-update-cache --add importme, [], [ignore], [ignore]) +AT_CHECK(echo 'commit 3' | git-commit-tree $(git-write-tree) -p $(cat .git/refs/heads/alt) >.git/refs/heads/alt, [], [ignore], [ignore]) +AT_CHECK(cp importme.1 importme) +AT_CHECK(git-update-cache importme, [], [ignore], [ignore]) +AT_CHECK(echo 'commit 1' | git-commit-tree $(git-write-tree) -p $(cat .git/HEAD) >.git/HEAD, [], [ignore], [ignore]) +AT_CHECK(cp importme.3 importme) +AT_CHECK(git-update-cache importme, [], [ignore], [ignore]) +AT_CHECK(echo 'commit merge' | git-commit-tree $(git-write-tree) -p $(cat .git/HEAD) -p $(cat .git/refs/heads/alt) >.git/HEAD, [], [ignore], [ignore]) + +# import into monotone and check presence of files + +AT_CHECK(MONOTONE --branch=testbranch git import .git, [], [ignore], [ignore]) +AT_CHECK(MONOTONE cat file $TSHA0, [], [ignore]) +AT_CHECK(MONOTONE cat file $TSHA1, [], [ignore]) +AT_CHECK(MONOTONE cat file $TSHA2, [], [ignore]) +AT_CHECK(MONOTONE cat file $TSHA3, [], [ignore]) + +# also check that history is okay -- has a unique head, and it's the +# right one. + +AT_CHECK(MONOTONE checkout --branch=testbranch mtcodir, [], [ignore], [ignore]) +AT_CHECK(cmp importme.3 mtcodir/importme) +AT_CHECK(rm -rf mtcodir) +AT_CHECK(MONOTONE checkout --branch=testbranch.alt mtcodir, [], [ignore], [ignore]) +AT_CHECK(cmp importme.2 mtcodir/importme) + +AT_CLEANUP ======================================================================== --- testsuite.at 8b06359186b938753e93cc2f99be2ef4d8309209 +++ testsuite.at b34ea1d8820a9210c19d36aa27225fda184766f2 @@ -708,3 +708,4 @@ m4_include(tests/t_restriction_with_exclude_iprint.at) m4_include(tests/t_gitimport.at) m4_include(tests/t_gitimport2.at) +m4_include(tests/t_gitimport_suturing.at)