{"thread":{"id":"4095","subject":"[PATCH] test case for transitive info/alternates","startedAt":"2006-05-07T18:19:47Z","lastAt":"2006-05-07T18:19:47Z","messageCount":1,"participants":["Martin Waitz"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"19658","messageId":"20060507181947.GE23738@admingilde.org","threadId":"4095","inReplyTo":null,"subject":"[PATCH] test case for transitive info/alternates","fromName":"Martin Waitz","fromEmail":"tali@admingilde.org","sentAt":"2006-05-07T18:19:47Z","receivedAt":"2006-05-07T18:19:47Z","isPatch":true,"sender":{"key":"tali@admingilde.org","avatar":"https://gravatar.com/avatar/3f89b03eee362187effabe257898735b475673a12265c398ea9161259ae91553?d=mp&s=160"},"body":"Signed-off-by: Martin Waitz <tali@admingilde.org>\n\n---\n\n t/t5710-info-alternate.sh |  105 +++++++++++++++++++++++++++++++++++++++++++++\n 1 files changed, 105 insertions(+), 0 deletions(-)\n create mode 100755 t/t5710-info-alternate.sh\n\n47d59f8b0c26226a40344673ecd9e6255a576b98\ndiff --git a/t/t5710-info-alternate.sh b/t/t5710-info-alternate.sh\nnew file mode 100755\nindex 0000000..097d037\n--- /dev/null\n+++ b/t/t5710-info-alternate.sh\n@@ -0,0 +1,105 @@\n+#!/bin/sh\n+#\n+# Copyright (C) 2006 Martin Waitz <tali@admingilde.org>\n+#\n+\n+test_description='test transitive info/alternate entries'\n+. ./test-lib.sh\n+\n+# test that a file is not reachable in the current repository\n+# but that it is after creating a info/alternate entry\n+reachable_via() {\n+\talternate=\"$1\"\n+\tfile=\"$2\"\n+\tif git cat-file -e \"HEAD:$file\"; then return 1; fi\n+\techo \"$alternate\" >> .git/objects/info/alternate\n+\tgit cat-file -e \"HEAD:$file\"\n+}\n+\n+test_valid_repo() {\n+\tgit fsck-objects --full > fsck.log &&\n+\ttest `wc -l < fsck.log` = 0\n+}\n+\n+base_dir=`pwd`\n+\n+test_expect_success 'preparing first repository' \\\n+'test_create_repo A && cd A &&\n+echo \"Hello World\" > file1 &&\n+git add file1 &&\n+git commit -m \"Initial commit\" file1 &&\n+git repack -a -d &&\n+git prune'\n+\n+cd \"$base_dir\"\n+\n+test_expect_success 'preparing second repository' \\\n+'git clone -l -s A B && cd B &&\n+echo \"foo bar\" > file2 &&\n+git add file2 &&\n+git commit -m \"next commit\" file2 &&\n+git repack -a -d -l &&\n+git prune'\n+\n+cd \"$base_dir\"\n+\n+test_expect_success 'preparing third repository' \\\n+'git clone -l -s B C && cd C &&\n+echo \"Goodbye, cruel world\" > file3 &&\n+git add file3 &&\n+git commit -m \"one more\" file3 &&\n+git repack -a -d -l &&\n+git prune'\n+\n+cd \"$base_dir\"\n+\n+test_expect_failure 'creating too deep nesting' \\\n+'git clone -l -s C D &&\n+git clone -l -s D E &&\n+git clone -l -s E F &&\n+git clone -l -s F G &&\n+test_valid_repo'\n+\n+cd \"$base_dir\"\n+\n+test_expect_success 'validity of third repository' \\\n+'cd C &&\n+test_valid_repo'\n+\n+cd \"$base_dir\"\n+\n+test_expect_success 'validity of fourth repository' \\\n+'cd D &&\n+test_valid_repo'\n+\n+cd \"$base_dir\"\n+\n+test_expect_success 'breaking of loops' \\\n+\"echo '$base_dir/B/.git/objects' >> '$base_dir'/A/.git/objects/info/alternates&&\n+cd C &&\n+test_valid_repo\"\n+\n+cd \"$base_dir\"\n+\n+test_expect_failure 'that info/alternates is neccessary' \\\n+'cd C &&\n+rm .git/objects/info/alternates &&\n+test_valid_repo'\n+\n+cd \"$base_dir\"\n+\n+test_expect_success 'that relative alternate is possible for current dir' \\\n+'cd C &&\n+echo \"../../../B/.git/objects\" > .git/objects/info/alternates &&\n+test_valid_repo'\n+\n+cd \"$base_dir\"\n+\n+test_expect_failure 'that relative alternate is only possible for current dir' \\\n+'cd D &&\n+test_valid_repo'\n+\n+cd \"$base_dir\"\n+\n+test_done\n+\n-- \n1.3.1.g6ef7\n"}]}