Signed-off-by: Miklos Vajna <redacted>
---
On Thu, Sep 20, 2007 at 11:34:25AM +0100, Johannes Schindelin [off-list ref] wrote:
On Wed, 19 Sep 2007, Junio C Hamano wrote:
quoted
Looks Ok to me, although I didn't verify the examples by
actually running them myself this time (last round I did).
So maybe we should do the same as with the tutorial: stick the examples
into a test script?
what about this?
t/t3060-subprojects-tutorial.sh | 62 +++++++++++++++++++++++++++++++++++++++
1 files changed, 62 insertions(+), 0 deletions(-)
create mode 100755 t/t3060-subprojects-tutorial.sh
diff --git a/t/t3060-subprojects-tutorial.sh b/t/t3060-subprojects-tutorial.sh
new file mode 100755
index 0000000..2fcf4ab
--- /dev/null
+++ b/t/t3060-subprojects-tutorial.sh
@@ -0,0 +1,62 @@
+#!/bin/sh
+#
+# Copyright (c) 2007 Miklos Vajna
+#
+
+test_description='A simple subprojects tutorial in the form of a test case'
+
+. ./test-lib.sh
+
+test_expect_success "create the submodules" '
+ for i in a b c d
+ do
+ mkdir $i &&
+ cd $i &&
+ git init &&
+ echo "module $i" > $i.txt &&
+ git add $i.txt &&
+ git commit -m "Initial commit, submodule $i" &&
+ cd ..
+ done
+'
+
+test_expect_success "create the superproject" '
+ mkdir super &&
+ cd super &&
+ git init &&
+ for i in a b c d
+ do
+ git submodule add '`pwd`'/$i
+ done
+'
+
+test_expect_success "commit in the superproject" '
+ git commit -m "Add submodules a, b, c and d." &&
+ cd ..
+'
+
+test_expect_success "clone the superproject" '
+ git clone super cloned &&
+ cd cloned
+'
+
+test_expect_success "submodule init" '
+ git submodule init
+'
+
+test_expect_success "submodule update" '
+ git submodule update
+'
+
+test_expect_success "update the submodule from within the superproject" '
+ cd a &&
+ echo "adding a line again" >> a.txt &&
+ git commit -a -m "Updated the submodule from within the superproject." &&
+ git push &&
+ cd .. &&
+ git add a &&
+ git commit -m "Updated submodule a." &&
+ git push
+'
+
+test_done
--
1.5.3.2.80.g077d6f-dirty