summaryrefslogtreecommitdiff
path: root/t/t4110-apply-scan.sh
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-08-29 00:57:45 (GMT)
committerJunio C Hamano <junkio@cox.net>2005-08-29 00:57:45 (GMT)
commit933693da77857b12ba86d999a601dbdb8ab212ff (patch)
tree7c35b415052a6e814dfb0d93db150ca41ab84bec /t/t4110-apply-scan.sh
parent0f583175317a1c5c57b56c87856fbe46c3f3c296 (diff)
parent9847f7e0db8359b3932fd51290d777610090c33f (diff)
downloadgit-933693da77857b12ba86d999a601dbdb8ab212ff.zip
git-933693da77857b12ba86d999a601dbdb8ab212ff.tar.gz
git-933693da77857b12ba86d999a601dbdb8ab212ff.tar.bz2
Merge refs/heads/master from .
Diffstat (limited to 't/t4110-apply-scan.sh')
-rw-r--r--t/t4110-apply-scan.sh101
1 files changed, 101 insertions, 0 deletions
diff --git a/t/t4110-apply-scan.sh b/t/t4110-apply-scan.sh
new file mode 100644
index 0000000..005f744
--- /dev/null
+++ b/t/t4110-apply-scan.sh
@@ -0,0 +1,101 @@
+#!/bin/sh
+#
+# Copyright (c) 2005 Junio C Hamano
+# Copyright (c) 2005 Robert Fitzsimons
+#
+
+test_description='git-apply test for patches which require scanning forwards and backwards.
+
+'
+. ./test-lib.sh
+
+# setup
+
+cat > patch1.patch <<\EOF
+diff --git a/new.txt b/new.txt
+new file mode 100644
+--- /dev/null
++++ b/new.txt
+@@ -0,0 +1,12 @@
++a1
++a11
++a111
++a1111
++b1
++b11
++b111
++b1111
++c1
++c11
++c111
++c1111
+EOF
+cat > patch2.patch <<\EOF
+diff --git a/new.txt b/new.txt
+--- a/new.txt
++++ b/new.txt
+@@ -1,7 +1,3 @@
+-a1
+-a11
+-a111
+-a1111
+ b1
+ b11
+ b111
+EOF
+cat > patch3.patch <<\EOF
+diff --git a/new.txt b/new.txt
+--- a/new.txt
++++ b/new.txt
+@@ -6,6 +6,10 @@
+ b11
+ b111
+ b1111
++b2
++b22
++b222
++b2222
+ c1
+ c11
+ c111
+EOF
+cat > patch4.patch <<\EOF
+diff --git a/new.txt b/new.txt
+--- a/new.txt
++++ b/new.txt
+@@ -1,3 +1,7 @@
++a1
++a11
++a111
++a1111
+ b1
+ b11
+ b111
+EOF
+cat > patch5.patch <<\EOF
+diff --git a/new.txt b/new.txt
+--- a/new.txt
++++ b/new.txt
+@@ -10,3 +10,7 @@
+ c11
+ c111
+ c1111
++c2
++c22
++c222
++c2222
+EOF
+
+test_expect_success "S = git-apply scan" \
+ 'git-apply patch1.patch patch2.patch patch3.patch patch4.patch patch5.patch'
+mv new.txt apply.txt
+
+test_expect_success "S = patch scan" \
+ 'cat patch1.patch patch2.patch patch3.patch patch4.patch patch5.patch | patch'
+mv new.txt patch.txt
+
+test_expect_success "S = cmp" \
+ 'cmp apply.txt patch.txt'
+
+test_done
+