summaryrefslogtreecommitdiffstats
path: root/test/repos
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2018-08-12 15:54:59 +1000
committerJesse Duffield <jessedduffield@gmail.com>2018-08-12 15:54:59 +1000
commit98c22a36fdaf8806f8fafe8f1e23e53f8e97658d (patch)
tree4e04dfe9889df3e06ebb43daa2810e557c552821 /test/repos
parent7bfd8155c2482afd3c09ac7991e8f8f7f0d0338b (diff)
rearrange test repo generators
Diffstat (limited to 'test/repos')
-rwxr-xr-xtest/repos/case_insensitive_checkouts.sh16
-rw-r--r--test/repos/extras/pre-commit7
-rwxr-xr-xtest/repos/lots_of_commits.sh16
-rwxr-xr-xtest/repos/merge_conflict.sh34
-rwxr-xr-xtest/repos/pre_commit_hook.sh9
-rwxr-xr-xtest/repos/unicode_characters.sh20
6 files changed, 102 insertions, 0 deletions
diff --git a/test/repos/case_insensitive_checkouts.sh b/test/repos/case_insensitive_checkouts.sh
new file mode 100755
index 000000000..23997a670
--- /dev/null
+++ b/test/repos/case_insensitive_checkouts.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+set -ex; rm -rf repo; mkdir repo; cd repo
+
+git init
+
+touch foo
+git add foo
+git commit -m "init"
+git branch -a
+git branch test
+git branch TEST
+git checkout TEST
+git checkout TeST
+git checkout TesT
+git checkout TEsT
+git branch -a \ No newline at end of file
diff --git a/test/repos/extras/pre-commit b/test/repos/extras/pre-commit
new file mode 100644
index 000000000..3f7e7a5bb
--- /dev/null
+++ b/test/repos/extras/pre-commit
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+echo "test1"
+sleep 1
+echo "test2"
+sleep 1
+echo "test3" \ No newline at end of file
diff --git a/test/repos/lots_of_commits.sh b/test/repos/lots_of_commits.sh
new file mode 100755
index 000000000..7c271f751
--- /dev/null
+++ b/test/repos/lots_of_commits.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+set -ex; rm -rf repo; mkdir repo; cd repo
+
+git init
+
+i=2
+end=100
+while [ $i -le $end ]; do
+ echo "file${i}" > file${i}
+ git add file${i}
+ git commit -m file${i}
+
+ i=$(($i+1))
+done
+
+echo "unstaged change" > file100
diff --git a/test/repos/merge_conflict.sh b/test/repos/merge_conflict.sh
new file mode 100755
index 000000000..8ba234203
--- /dev/null
+++ b/test/repos/merge_conflict.sh
@@ -0,0 +1,34 @@
+#!/bin/bash
+set -ex; rm -rf repo; mkdir repo; cd repo
+
+git init
+
+function add_spacing {
+ for i in {1..60}
+ do
+ echo "..." >> $1
+ done
+}
+
+echo "Here is a story that has been told throuhg the ages" >> file1
+
+git add file1
+git commit -m "first commit"
+
+git checkout -b develop
+
+echo "once upon a time there was a dog" >> file1
+add_spacing file1
+echo "once upon a time there was another dog" >> file1
+git add file1
+git commit -m "first commit on develop"
+
+git checkout master
+
+echo "once upon a time there was a cat" >> file1
+add_spacing file1
+echo "once upon a time there was another cat" >> file1
+git add file1
+git commit -m "first commit on develop"
+
+git merge develop # should have a merge conflict here
diff --git a/test/repos/pre_commit_hook.sh b/test/repos/pre_commit_hook.sh
new file mode 100755
index 000000000..8857f4145
--- /dev/null
+++ b/test/repos/pre_commit_hook.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+set -ex; rm -rf repo; mkdir repo; cd repo
+
+git init
+cp ../pre-commit .git/hooks/pre-commit
+chmod +x .git/hooks/pre-commit
+
+echo "file" > file
+git add file
diff --git a/test/repos/unicode_characters.sh b/test/repos/unicode_characters.sh
new file mode 100755
index 000000000..69ac5e622
--- /dev/null
+++ b/test/repos/unicode_characters.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+set -ex; rm -rf repo; mkdir repo; cd repo
+
+git init
+
+# Add some ansi, unicode, zero width joiner caracters
+cat <<EOT >> charstest.txt
+ANSI Π(U+0152 &OElig; Latin capital ligature OE Latin Extended-A)
+ ¥ (0xA5 U+00A5 &yen; yes sign)
+ ƒ (0x83 U+0192 &fnof; Latin small letter f with hook)
+ZWJ https://en.wikipedia.org/wiki/Zero-width_joiner / https://unicode.org/Public/emoji/4.0/emoji-zwj-sequences.txt 👶(👨‍👦)
+UNICODE ☆ 🤓 え 术
+EOT
+git add charstest.txt
+git commit -m "Test chars Œ¥ƒ👶👨‍👦☆ 🤓 え 术 commit"
+echo "我喜歡編碼" >> charstest.txt
+echo "நான் குறியீடு விரும்புகிறேன்" >> charstest.txt
+git add charstest.txt
+git commit -m "Test chars 我喜歡編碼 நான் குறியீடு விரும்புகிறேன் commit"
+