{"thread":{"id":"32942","subject":"[PATCH v2 2/3] contrib/subtree/t: Added tests for .gitsubtree support","startedAt":"2013-02-19T12:31:20Z","lastAt":"2013-02-19T12:31:20Z","messageCount":1,"participants":["Paul Campbell"],"isPatch":true,"patchVersion":2,"patchTotal":3},"messages":[{"id":"209815","messageId":"CALeLG_nfq9eSNw6UMYK0OzpK3r2NKTeK4H4Qyot-4r_r342+nA@mail.gmail.com","threadId":"32942","inReplyTo":null,"subject":"[PATCH v2 2/3] contrib/subtree/t: Added tests for .gitsubtree support","fromName":"Paul Campbell","fromEmail":"pcampbell@kemitix.net","sentAt":"2013-02-19T12:31:20Z","receivedAt":"2013-02-19T12:31:20Z","isPatch":true,"sender":{"key":"pcampbell@kemitix.net","avatar":"https://gravatar.com/avatar/57584e05501b694929004e43fcd7308f4ad64df2eb0474cd8c7e5f93662bb0f1?d=mp&s=160"},"body":"add: ensure details are added to .gitsubtree\npush: check for a SHA1 update line\npull: add a file on one subtree, push it to a branch, then pull into\n    another subtree containing the same branch and confirm the files match\nadd: ensure stale .gitsubtree entry is replaced\n\nSigned-off-by: Paul Campbell <pcampbell@kemitix.net>\n---\n contrib/subtree/t/t7900-subtree.sh | 42 ++++++++++++++++++++++++++++++++++++++\n 1 file changed, 42 insertions(+)\n\ndiff --git a/contrib/subtree/t/t7900-subtree.sh\nb/contrib/subtree/t/t7900-subtree.sh\nindex 80d3399..f1a24cf 100755\n--- a/contrib/subtree/t/t7900-subtree.sh\n+++ b/contrib/subtree/t/t7900-subtree.sh\n@@ -465,4 +465,46 @@ test_expect_success 'verify one file change per commit' '\n         ))\n '\n\n+# return to mainline\n+cd ../..\n+\n+# .gitsubtree\n+test_expect_success 'added repository appears in .gitsubtree' '\n+\tgit subtree add --prefix=copy0 sub1 &&\n+\tgrep \"^copy0 \\. sub1$\" .gitsubtree\n+'\n+\n+test_expect_success 'change in subtree is pushed okay' '\n+\t(\n+\t\tcd copy0 &&\n+\t\tcreate new_file &&\n+\t\tgit commit -m\"Added new_file\"\n+\t) &&\n+\tgit ls-tree refs/heads/sub1 >output &&\n+\t! grep \"new_file$\" output &&\n+\tgit subtree push --prefix=copy0 &&\n+\tgit ls-tree refs/heads/sub1 >output &&\n+\tgrep \"new_file$\" output\n+'\n+\n+test_expect_success 'pull into subtree okay' '\n+\tgit subtree add --prefix=copy1 sub1 &&\n+\tgit subtree add --prefix=copy2 sub1 &&\n+\t(\n+\t\tcd copy1 &&\n+\t\tcreate new_file_in_copy1 &&\n+\t\tgit commit -m\"Added new_file_in_copy1\"\n+\t) &&\n+\tgit subtree push --prefix=copy1 &&\n+\tgit subtree pull --prefix=copy2 >output &&\n+\tgrep \"^ create mode 100644 copy2/new_file_in_copy1$\" output\n+'\n+\n+test_expect_success 'replace outdated entry in .gitsubtree' '\n+\techo \"copy3 . sub2\" >>.gitsubtree &&\n+\tgit subtree add --prefix=copy3 sub1 &&\n+\t! grep \"^copy3 . sub2$\" .gitsubtree &&\n+\tgrep \"^copy3 . sub1$\" .gitsubtree\n+'\n+\n test_done\n-- \n1.8.2.rc0.16.g20a599e\n"}]}