{"thread":{"id":"32894","subject":"[PATCH 3/4] contrib/subtree/t: Added tests for .gitsubtree support","startedAt":"2013-02-12T23:23:55Z","lastAt":"2013-02-12T23:23:55Z","messageCount":1,"participants":["Paul Campbell"],"isPatch":true,"patchVersion":1,"patchTotal":4},"messages":[{"id":"209439","messageId":"CALeLG_=v-XwTygQKOD2JDWmbD0oVV=R+HnXi3dBXtXykV0wXKQ@mail.gmail.com","threadId":"32894","inReplyTo":null,"subject":"[PATCH 3/4] contrib/subtree/t: Added tests for .gitsubtree support","fromName":"Paul Campbell","fromEmail":"pcampbell@kemitix.net","sentAt":"2013-02-12T23:23:55Z","receivedAt":"2013-02-12T23:23:55Z","isPatch":true,"sender":{"key":"pcampbell@kemitix.net","avatar":"https://gravatar.com/avatar/57584e05501b694929004e43fcd7308f4ad64df2eb0474cd8c7e5f93662bb0f1?d=mp&s=160"},"body":" 55 add: ensure details are added to .gitsubtree\n 56 push: check for a SHA1 update line\n 57 pull: 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\n 58 add: ensure stale .gitsubtree entry is replaced\n\nSigned-off-by: Paul Campbell <pcampbell@kemitix.net>\n---\n contrib/subtree/t/t7900-subtree.sh | 34 ++++++++++++++++++++++++++++++++++\n 1 file changed, 34 insertions(+)\n\ndiff --git a/contrib/subtree/t/t7900-subtree.sh\nb/contrib/subtree/t/t7900-subtree.sh\nindex bc2eeb0..5ae4584 100755\n--- a/contrib/subtree/t/t7900-subtree.sh\n+++ b/contrib/subtree/t/t7900-subtree.sh\n@@ -505,4 +505,38 @@ test_expect_success 'verify one file change per commit' '\n         ))\n '\n\n+# return to mainline\n+cd ../..\n+\n+# .gitsubtree\n+# 55\n+test_expect_success 'added repository appears in .gitsubtree' '\n+        git subtree add --prefix=copy0 sub1 &&\n+        grep \"^copy0 \\. sub1$\" .gitsubtree\n+'\n+\n+# 56\n+test_expect_success 'change in subtree is pushed okay' '\n+        cd copy0 && create new_file && git commit -m\"Added new_file\" &&\n+        cd .. && git subtree push --prefix=copy0 2>&1 | \\\n+                grep -E \"^   [0-9a-f]{7}\\.\\.[0-9a-f]{7}  [0-9a-f]{40} -> sub1$\"\n+'\n+\n+# 57\n+test_expect_success 'pull into subtree okay' '\n+        git subtree add --prefix=copy1 sub1 &&\n+        git subtree add --prefix=copy2 sub1 &&\n+        cd copy1 && create new_file_in_copy1 && git commit -m\"Added\nnew_file_in_copy1\" &&\n+        cd .. && git subtree push --prefix=copy1 &&\n+        git subtree pull --prefix=copy2 | grep \"^ create mode 100644\ncopy2/new_file_in_copy1$\"\n+'\n+\n+# 58\n+test_expect_success 'replace outdated entry in .gitsubtree' '\n+        echo \"copy3 . sub2\" >> .gitsubtree &&\n+        git subtree add --prefix=copy3 sub1 &&\n+        (grep \"^copy3 . sub2$\" .gitsubtree && die || true) &&\n+        grep \"^copy3 . sub1$\" .gitsubtree\n+'\n+\n test_done\n-- \n1.8.1.3.566.gaa39828\n"}]}