{"thread":{"id":"15747","subject":"[PATCH v3] tests: add a testcase for \"git submodule sync\"","startedAt":"2008-10-02T09:11:55Z","lastAt":"2008-10-02T09:11:55Z","messageCount":1,"participants":["David Aguilar"],"isPatch":true,"patchVersion":3,"patchTotal":null},"messages":[{"id":"92123","messageId":"4383bf658ddce38cedd33bf388039cb10c004940.1222938595.git.davvid@gmail.com","threadId":"15747","inReplyTo":null,"subject":"[PATCH v3] tests: add a testcase for \"git submodule sync\"","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2008-10-02T09:11:55Z","receivedAt":"2008-10-02T09:11:55Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"This testcase ensures that upstream changes to submodule properties\ncan be updated using the sync subcommand.  This particular test\nchanges the submodule URL upstream and uses the sync command to update\nan existing checkout.\n\nSigned-off-by: David Aguilar <davvid@gmail.com>\n---\n\n sorry for the noise, :-/ please disregard the last two emails\n\n t/t7403-submodule-sync.sh |   64 +++++++++++++++++++++++++++++++++++++++++++++\n 1 files changed, 64 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t7403-submodule-sync.sh b/t/t7403-submodule-sync.sh\nnew file mode 100755\nindex 0000000..d9e04d4\n--- /dev/null\n+++ b/t/t7403-submodule-sync.sh\n@@ -0,0 +1,64 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2008 David Aguilar\n+#\n+\n+test_description='git submodule sync\n+\n+These tests exercise the \"git submodule sync\" subcommand.\n+'\n+\n+. ./test-lib.sh\n+\n+test_expect_success setup '\n+\techo file > file &&\n+\tgit add file &&\n+\ttest_tick &&\n+\tgit commit -m upstream\n+\tgit clone . super &&\n+\tgit clone super submodule &&\n+\t(cd super &&\n+\t git submodule add ../submodule submodule &&\n+\t test_tick &&\n+\t git commit -m \"submodule\"\n+\t) &&\n+\tgit clone super super-clone &&\n+\t(cd super-clone && git submodule update --init)\n+'\n+\n+test_expect_success 'change submodule' '\n+\t(cd submodule &&\n+\t echo second line >> file &&\n+\t test_tick &&\n+\t git commit -a -m \"change submodule\"\n+\t)\n+'\n+\n+test_expect_success 'change submodule url' '\n+\t(cd super &&\n+\t cd submodule &&\n+\t git checkout master && \n+\t git pull\n+\t) &&\n+\tmv submodule moved-submodule &&\n+\t(cd super &&\n+\t git config -f .gitmodules submodule.submodule.url ../moved-submodule\n+\t test_tick &&\n+\t git commit -a -m moved-submodule\n+\t)\n+'\n+\n+test_expect_success '\"git submodule sync\" should update submodule URLs' '\n+\t(cd super-clone &&\n+\t git pull &&\n+\t git submodule sync\n+\t) &&\n+\ttest -d \"$(git config -f super-clone/submodule/.git/config \\\n+\t                        remote.origin.url)\" &&\n+\t(cd super-clone/submodule &&\n+\t git checkout master &&\n+\t git pull\n+\t)\n+'\n+\n+test_done\n-- \n1.6.0.2.428.g5e22e\n"}]}