aboutsummaryrefslogtreecommitdiffstats
path: root/tests/create-repo.sh
diff options
context:
space:
mode:
authorAdam Spiers <git@adamspiers.org>2016-06-11 22:20:04 +0100
committerAdam Spiers <git@adamspiers.org>2018-05-15 13:42:16 +0100
commit2c9d23b0291157eb1096384ff76e0122747b9bdf (patch)
tree524c7b479b65a478c998c28475d52e636b919200 /tests/create-repo.sh
parent9a741f07167dcb6cc81a8f87036d1ea75c4270d3 (diff)
downloadgit-deps-2c9d23b0291157eb1096384ff76e0122747b9bdf.tar.gz
convert into a proper Python module
Sem-Ver: api-break
Diffstat (limited to 'tests/create-repo.sh')
-rwxr-xr-xtests/create-repo.sh60
1 files changed, 60 insertions, 0 deletions
diff --git a/tests/create-repo.sh b/tests/create-repo.sh
new file mode 100755
index 0000000..bfaffe2
--- /dev/null
+++ b/tests/create-repo.sh
@@ -0,0 +1,60 @@
+#!/bin/bash
+
+here=$(dirname $0)
+
+tag () {
+ git tag "$@"
+ echo -n "Hit Enter to continue ..."
+ read
+}
+
+test_repo=$here/test-repo
+
+rm -rf $test_repo
+mkdir $test_repo
+cd $test_repo
+
+git init
+git config user.email git-deps-test@fake.address
+
+# Start with two independently committed files
+
+for f in file-{a,b}; do
+ cat <<EOF > $f
+one
+two
+three
+four
+five
+six
+seven
+eight
+nine
+ten
+EOF
+
+ git add $f
+ git commit -m "create $f"
+ tag $f
+done
+
+# Now start making changes
+
+sed -i 's/three/three a/' file-a
+git commit -am 'file-a: change three to three a'
+tag file-a-three-a # depends on file-a
+
+sed -i 's/three/three a/' file-b
+git commit -am 'file-b: change three to three a'
+tag file-b-three-a # depends on file-b
+
+# Change non-overlapping part of previously changed file
+sed -i 's/eight/eight a/' file-a
+git commit -am 'file-a: change eight to eight a'
+tag file-a-eight-a # depends on file-a
+
+# Change previously changed line
+sed -i 's/three a/three b/' file-a
+git commit -am 'file-a: change three a to three b'
+tag file-a-three-b # depends on file-a-three-a
+